add account name in saleitem xls

This commit is contained in:
Myat Zin Wai Maw
2019-09-12 19:29:04 +06:30
parent e0b54728f7
commit b2ab2c9632

View File

@@ -24,7 +24,7 @@
</tr>
<% end %>
<tr>
<th>&nbsp;</th>
<th><%= t("views.right_panel.header.account_name") %></th>
<th><%= t("views.right_panel.header.menu_category") %></th>
<th><%= t("views.right_panel.detail.code") %></th>
<th><%= t("views.right_panel.detail.product") %></th>
@@ -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) %>
<tr>
<td><b><%= sale.account_name %></b></td>
<td colspan="4">&nbsp;</td>
<td><%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %></td>
<td>
<% @totalByAccount.each do |account, total| %>
<% if sale.account_id == account %>
<b><%= number_with_precision(total, precision:precision.to_i,delimiter:delimiter) %></b>
<% grand_total += total %>
<% end %>
<% end %>
</td>
</tr>
<% acc_arr.push(sale.account_id) %>
<% end %>
<tr>
<td>&nbsp;</td>
<td><%= sale.account_name %></td>
<td><%= sale.menu_category_name %></td>
<td><%= sale.item_code rescue '-' %></td>
<td><%= sale.product_name rescue '-' %></td>