From 8f0950f5a171a88e98439aaa131dbf7e00b634d6 Mon Sep 17 00:00:00 2001 From: NyanLinHtut Date: Mon, 13 Jul 2020 11:36:07 +0630 Subject: [PATCH] added total by account on xls --- app/views/reports/saleitem/index.xls.erb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/views/reports/saleitem/index.xls.erb b/app/views/reports/saleitem/index.xls.erb index 6c04d8bd..4eaa3460 100755 --- a/app/views/reports/saleitem/index.xls.erb +++ b/app/views/reports/saleitem/index.xls.erb @@ -78,13 +78,19 @@ total_item_dis += sale.grand_total*(-1) end %> <% if !acc_arr.include?(sale.account_id) %> - - <% @totalByAccount.each do |account, total| %> - <% if sale.account_id == account %> - - <% grand_total += total %> - <% end %> - <% end %> + + <%= sale.account_name %> +   + <%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %> + + <% @totalByAccount.each do |account, total| %> + <% if sale.account_id == account %> + <%= number_format(total, precision:precision.to_i,delimiter:delimiter) %> + <% grand_total += total %> + <% end %> + <% end %> + + <% acc_arr.push(sale.account_id) %> <% end %>