update sale item reoprt for item dis and foc

This commit is contained in:
Aung Myo
2017-12-05 18:19:18 +06:30
parent 97bb6ae211
commit f4a7e1baa0
3 changed files with 11 additions and 10 deletions

View File

@@ -65,10 +65,18 @@
<% @sale_data.each do |sale| %>
<% if sale.total_item > 0 && sale.status_type != "Discount" && sale.status_type != "foc"
<% if sale.status_type != "Discount" && sale.status_type != "foc"
total_qty += sale.total_item
end %>
<% if sale.status_type == "foc" && sale.grand_total < 0
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 !acc_arr.include?(sale.account_id) %>
<tr>
<td><b><%= sale.account_name %></b></td>
@@ -111,13 +119,6 @@
<td><%= t("views.right_panel.detail.sub_total") %></td>
<td ><span class="underline"><%= sub_total %></span></td>
</tr>
<% if sale.status_type === "foc"
total_item_foc += sale.grand_total
end %>
<% if sale.status_type === "Discount"
total_item_dis += sale.grand_total
end %>
<% sub_total = 0.0%>
<% count = 0%>
<% end %>