diff --git a/app/views/reports/product_sale/index.html.erb b/app/views/reports/product_sale/index.html.erb index 4670f6b3..5cd38e52 100644 --- a/app/views/reports/product_sale/index.html.erb +++ b/app/views/reports/product_sale/index.html.erb @@ -59,6 +59,7 @@ <% total_data = {} %> <% @sale_data.each do |sale| if !total_item.has_key?(sale.item_code) + grand_total += sale.grand_total total_item[sale.item_code] = sale.total_item total_data[sale.item_code] = sale.grand_total else @@ -67,13 +68,13 @@ end if sale.status_type == "void" || sale.status_type == "Discount" || sale.status_type == "foc" total_data[sale.item_code] += sale.grand_total + grand_total += sale.grand_total end end end %> <% @sale_data.each do |sale| %> - <% grand_total += sale.grand_total %> - <% if sale.status_type != "Discount" && sale.status_type != "foc" + <% if sale.status_type != "Discount" && sale.status_type != "foc" && sale.status_type != "promotion" total_qty += sale.total_item end %> <% if sale.status_type == "foc" && sale.price > 0 diff --git a/app/views/reports/product_sale/index.xls.erb b/app/views/reports/product_sale/index.xls.erb index 98885861..b15c7270 100644 --- a/app/views/reports/product_sale/index.xls.erb +++ b/app/views/reports/product_sale/index.xls.erb @@ -32,6 +32,7 @@ <% total_data = {} %> <% @sale_data.each do |sale| if !total_item.has_key?(sale.item_code) + grand_total += sale.grand_total total_item[sale.item_code] = sale.total_item total_data[sale.item_code] = sale.grand_total else @@ -40,13 +41,13 @@ end if sale.status_type == "void" || sale.status_type == "Discount" || sale.status_type == "foc" total_data[sale.item_code] += sale.grand_total + grand_total += sale.grand_total end end end %> <% @sale_data.each do |sale| %> - <% grand_total += sale.grand_total %> - <% if sale.status_type != "Discount" && sale.status_type != "foc" + <% if sale.status_type != "Discount" && sale.status_type != "foc" && sale.status_type != "promotion" total_qty += sale.total_item end %> <% if sale.status_type == "foc" && sale.price > 0