From 953e3e83f173a52a1ee27c2c653d386f78ae4208 Mon Sep 17 00:00:00 2001 From: phyusin Date: Mon, 17 Sep 2018 11:39:44 +0630 Subject: [PATCH] add receipt no for online order --- app/models/order_reservation.rb | 2 +- app/views/reports/credit_payment/index.html.erb | 2 +- app/views/reports/credit_payment/index.xls.erb | 2 +- app/views/reports/order_reservation/index.html.erb | 4 +++- app/views/reports/order_reservation/index.xls.erb | 4 +++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/models/order_reservation.rb b/app/models/order_reservation.rb index e2db107f..1db61331 100644 --- a/app/models/order_reservation.rb +++ b/app/models/order_reservation.rb @@ -408,7 +408,7 @@ class OrderReservation < ApplicationRecord end end - query = OrderReservation.select("order_reservations.*, sales.receipt_date, deliveries.provider, deliveries.delivery_fee, customers.name, customers.email") + query = OrderReservation.select("order_reservations.*, sales.receipt_date, sales.receipt_no, deliveries.provider, deliveries.delivery_fee, customers.name, customers.email") .joins(" JOIN deliveries on deliveries.order_reservation_id = order_reservations.order_reservation_id") .joins(" JOIN customers on customers.customer_id = order_reservations.customer_id") .joins(" JOIN sales on sales.sale_id = order_reservations.sale_id") diff --git a/app/views/reports/credit_payment/index.html.erb b/app/views/reports/credit_payment/index.html.erb index ed8ee8a1..d7926361 100755 --- a/app/views/reports/credit_payment/index.html.erb +++ b/app/views/reports/credit_payment/index.html.erb @@ -90,7 +90,7 @@ <% end %> - Total + Total <%= number_with_precision(total_credit_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %> <%= number_with_precision(total_credit_payment, precision: precision.to_i ,delimiter: delimiter) rescue '-' %> diff --git a/app/views/reports/credit_payment/index.xls.erb b/app/views/reports/credit_payment/index.xls.erb index 3e38911a..d2d9f5cb 100755 --- a/app/views/reports/credit_payment/index.xls.erb +++ b/app/views/reports/credit_payment/index.xls.erb @@ -62,7 +62,7 @@ <% end %> - Total + Total <%= total_credit_amount rescue '-' %> <%= total_credit_payment rescue '-' %> diff --git a/app/views/reports/order_reservation/index.html.erb b/app/views/reports/order_reservation/index.html.erb index 07dba055..bb6265e0 100755 --- a/app/views/reports/order_reservation/index.html.erb +++ b/app/views/reports/order_reservation/index.html.erb @@ -42,6 +42,7 @@ <%= t("views.right_panel.detail.receipt_date") %> + <%= t("views.right_panel.detail.receipt_no") %> <%= t :reference_number %> <%= t :customer %> @@ -139,6 +140,7 @@ %> <%= order_reservation.receipt_date.utc.getlocal.strftime("%Y-%m-%d") %> + <%= order_reservation.receipt_no %> <%= order_reservation.transaction_ref %> <%= order_reservation.name %> @@ -160,7 +162,7 @@ end %> - Total + Total <%= number_with_precision(total_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> <%= number_with_precision(total_discount_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> <%= number_with_precision(total_delivery_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> diff --git a/app/views/reports/order_reservation/index.xls.erb b/app/views/reports/order_reservation/index.xls.erb index bd27fa36..285caf8e 100755 --- a/app/views/reports/order_reservation/index.xls.erb +++ b/app/views/reports/order_reservation/index.xls.erb @@ -25,6 +25,7 @@ <%= t("views.right_panel.detail.receipt_date") %> + <%= t("views.right_panel.detail.receipt_no") %> <%= t :reference_number %> <%= t :customer %> @@ -115,6 +116,7 @@ %> <%= order_reservation.receipt_date.utc.getlocal.strftime("%Y-%m-%d") %> + <%= order_reservation.receipt_no %> <%= order_reservation.transaction_ref %> <%= order_reservation.name %> @@ -136,7 +138,7 @@ end %> - Total + Total <%= total_amount rescue '0.0'%> <%= total_discount_amount rescue '0.0'%> <%= total_delivery_fee rescue '0.0'%>