From b2ab2c9632cfd961b8b2eaabe497445ec71a181e Mon Sep 17 00:00:00 2001 From: Myat Zin Wai Maw Date: Thu, 12 Sep 2019 19:29:04 +0630 Subject: [PATCH] add account name in saleitem xls --- app/views/reports/saleitem/index.xls.erb | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/views/reports/saleitem/index.xls.erb b/app/views/reports/saleitem/index.xls.erb index b5f7f3ef..799ede63 100755 --- a/app/views/reports/saleitem/index.xls.erb +++ b/app/views/reports/saleitem/index.xls.erb @@ -24,7 +24,7 @@ <% end %> -   + <%= t("views.right_panel.header.account_name") %> <%= t("views.right_panel.header.menu_category") %> <%= t("views.right_panel.detail.code") %> <%= t("views.right_panel.detail.product") %> @@ -89,25 +89,18 @@ <% if sale.status_type == "Discount" && sale.grand_total < 0 total_item_dis += sale.grand_total*(-1) end %> - <% if !acc_arr.include?(sale.account_id) %> - - <%= 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_with_precision(total, precision:precision.to_i,delimiter:delimiter) %> + <% grand_total += total %> <% end %> <% end %> - - <% acc_arr.push(sale.account_id) %> <% end %> -   + <%= sale.account_name %> <%= sale.menu_category_name %> <%= sale.item_code rescue '-' %> <%= sale.product_name rescue '-' %>