From 9402cde2bcbc8d33c56a19bba8e4fd609f6ce26e Mon Sep 17 00:00:00 2001 From: Yan Date: Mon, 10 Jul 2017 09:59:26 +0630 Subject: [PATCH] fix grand total in receipt no --- app/models/sale.rb | 2 +- app/views/reports/receipt_no/index.html.erb | 4 +++- dump.rdb | Bin 873 -> 838 bytes 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 2ffa5afd..661222bc 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -596,7 +596,7 @@ def self.get_separate_tax(from,to,payment_type=nil) end def grand_total_after_rounding - return self.grand_total.to_f + self.rounding_adjustment.to_f + return self.old_grand_total.to_f + self.rounding_adjustment.to_f end def get_cash_amount diff --git a/app/views/reports/receipt_no/index.html.erb b/app/views/reports/receipt_no/index.html.erb index aa117624..d30d6154 100644 --- a/app/views/reports/receipt_no/index.html.erb +++ b/app/views/reports/receipt_no/index.html.erb @@ -53,6 +53,7 @@ <% grand_total = 0 %> + <% old_grand_total = 0 %> <% total_tax = 0 %> <% guest_count = 0 %> <% total_sum = 0 %> @@ -66,6 +67,7 @@ @sale_data.each do |result| %> <% grand_total = grand_total.to_f + result.grand_total.to_f %> + <% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %> <% total_tax += result.total_tax.to_f %> <% total_sum += result.total_amount.to_f %> <% discount_amt += result.total_discount.to_f %> @@ -98,7 +100,7 @@ <%= grand_total.to_f.round(2) rescue '-'%> <%= rounding_adj rescue '-'%> - <%= grand_total.to_f.round + rounding_adj %> + <%= old_grand_total.to_f.round + rounding_adj %>   diff --git a/dump.rdb b/dump.rdb index 8ad94b1504af633cf43a4c93df8a551a46c2bfcd..abdaadff833a9b4eeb9249b09d54c42a8aae4722 100644 GIT binary patch delta 107 zcmV-x0F?jf2F3=EFc^aSVOjbJb#rB8Ep26O!mwKh0R8~`6akZ=0u+&4u>k^;4gn$w zhDyICT>$_91d~Am7L!i_1`-i5G&wmnIWsjmHZD0fH8?mqlV}0Wk?|LkZUQj@!;_!_ N!3dqaLVU4u`OBrIB!B<_ delta 139 zcmX@c_L6OafrS00#K>P9rNyZ!y1A*jhc?KHF#KcqEy_4KkV#}>%tl6r$$X4TEHZiv zRVSM;Dhdl3npj$znwwadnCTe<8HVO2lhYZ`Dlu^u6y+zU78j=$Gm2Iw=2;nASXx?H qm>Z@f86}&UrWu+~{3t%zo5_&rAQQ;w$&;AYa0oMSWc;sEzXJfuvMM|P