product sale checked
This commit is contained in:
@@ -58,14 +58,14 @@
|
||||
<% total_qty = 0 %>
|
||||
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% grand_total += sale.grand_total %>
|
||||
<% if sale.status_type != "Discount" && sale.status_type != "foc"
|
||||
total_qty += sale.total_item
|
||||
end %>
|
||||
<% if sale.status_type == "foc" && sale.price > 0
|
||||
total_qty += sale.total_item
|
||||
end %>
|
||||
|
||||
<% grand_total += sale.grand_total %>
|
||||
<% if sale.status_type != "Discount" && sale.status_type != "foc"
|
||||
total_qty += sale.total_item
|
||||
end %>
|
||||
<% if sale.status_type == "foc" && sale.price > 0
|
||||
total_qty += sale.total_item
|
||||
end %>
|
||||
<% if !sale.status_type %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
@@ -81,8 +81,9 @@
|
||||
<td><%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td><%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-' %></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
<!-- end sub total -->
|
||||
<!-- sub total -->
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
|
||||
@@ -23,31 +23,40 @@
|
||||
<% total_qty = 0 %>
|
||||
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% grand_total += sale.grand_total %>
|
||||
<% if sale.status_type != "Discount" && sale.status_type != "foc"
|
||||
total_qty += sale.total_item
|
||||
grand_total += sale.grand_total
|
||||
end %>
|
||||
<% if sale.status_type == "foc" && sale.price > 0
|
||||
total_qty += sale.total_item
|
||||
grand_total += sale.grand_total
|
||||
end %>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<td><%= sale.item_code rescue '-' %></td>
|
||||
<td><%= sale.product_name rescue '-' %></td>
|
||||
<td><%= sale.total_item rescue '-' %></td>
|
||||
<td><%= sale.unit_price rescue '-' %></td>
|
||||
<td><%= sale.grand_total rescue '-' %></td>
|
||||
</tr>
|
||||
<% if !sale.status_type %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<% cate_arr.push(sale.menu_category_id) %>
|
||||
<% else %>
|
||||
<% cate_arr = Array.new %>
|
||||
<td> </td>
|
||||
<% end %>
|
||||
<td><%= sale.item_code rescue '-' %></td>
|
||||
<td><%= sale.product_name rescue '-' %></td>
|
||||
<td><%= sale.total_item rescue ' ' %></td>
|
||||
<td><%= sale.unit_price rescue ' ' %></td>
|
||||
<td><%= sale.grand_total rescue ' ' %></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
<td><strong>Total</strong></td>
|
||||
<td><strong><%= total_qty %></strong></td>
|
||||
<td><strong><%= total_qty rescue ' ' %></strong></td>
|
||||
<td></td>
|
||||
<td><strong><%= grand_total rescue '-' %></strong></td>
|
||||
<td><strong><%= grand_total rescue ' ' %></strong></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user