promotion add in report

This commit is contained in:
Aung Myo
2018-06-21 14:39:34 +06:30
parent e45e17968f
commit ad4bf1451b
5 changed files with 69 additions and 10 deletions

View File

@@ -79,7 +79,7 @@
<% @sale_data.each do |sale| %>
<!-- all total qty sum -->
<% 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
@@ -88,6 +88,9 @@
<% if sale.status_type == "Discount"
total_qty += sale.total_item*(-1)
end %>
<% if sale.remark =="promotion"
total_qty += sale.total_item
end %>
<!-- end all total qty -->
<% if sale.status_type == "foc" && sale.grand_total < 0
@@ -140,12 +143,16 @@
<% count = count + 1 %>
<% sub_total += sale.grand_total %>
<% #sub_qty += sale.total_item %>
<% if sale.status_type !="Discount" && (!sale.product_name.include? "FOC")
<% if sale.status_type !="Discount" && (!sale.product_name.include? "FOC") && sale.status_type != "promotion"
sub_qty += sale.total_item
end %>
<% if sale.status_type =="Discount"
sub_qty += sale.total_item*(-1)
end %>
<% if sale.remark == "promotion"
sub_qty += sale.total_item
end %>
<% if count == value %>
<tr>
<td colspan="3">&nbsp;</td>