From 8e19b26fbcc695f681bf29972126a343c52a3aba Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 9 Jan 2018 10:29:45 +0630 Subject: [PATCH] update sale item qty sum --- app/views/reports/saleitem/index.html.erb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/views/reports/saleitem/index.html.erb b/app/views/reports/saleitem/index.html.erb index fbc518a6..4ad30d82 100644 --- a/app/views/reports/saleitem/index.html.erb +++ b/app/views/reports/saleitem/index.html.erb @@ -83,12 +83,12 @@ end %> <% if sale.status_type == "foc" && sale.grand_total < 0 - total_item_foc += sale.grand_total*(-1) - end %> + total_item_foc += sale.grand_total*(-1) + end %> - <% if sale.status_type == "Discount" && sale.grand_total < 0 - total_item_dis += sale.grand_total*(-1) - end %> + <% if sale.status_type == "Discount" && sale.grand_total < 0 + total_item_dis += sale.grand_total*(-1) + end %> <% if !acc_arr.include?(sale.account_id) %> @@ -126,7 +126,10 @@ <% if sale.account_id == key %> <% count = count + 1 %> <% sub_total += sale.grand_total %> - <% sub_qty += sale.total_item %> + <% #sub_qty += sale.total_item %> + <% if sale.status_type != "Discount" && sale.status_type != "foc" + sub_qty += sale.total_item + end %> <% if count == value %>