<%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_waste_and_spoilage_index_path} %>
Report For <%= @sale_type? @sale_type : 'Waste' %>
<% receipt_arr = Array.new %>
<% menu_cat_arr = Array.new %>
<% footer_arr = Array.new %>
<% count = 0 %>
<% waste_and_spoil_item_count = 0%>
<% @sale_data.each do |sale| %>
<% if !receipt_arr.include?(sale.receipt_no) %>
|
|
Receipt No :<%= sale.receipt_no %>
|
|
|
Date : <%= sale.created_at.utc.getlocal.strftime("%e,%b %Y %I:%M %p") %> |
| Menu Category |
Item Name |
Item Code |
Qty |
Price |
Total Price |
<% receipt_arr.push(sale.receipt_no) %>
<% menu_cat_arr.clear %>
<% count = 0 %>
<% end %>
<% if !sale.item_instance_code.nil?%>
<% waste_and_spoil_item_count += sale.qty.to_i %>
<% if !menu_cat_arr.include?(sale.name) %>
| <%= sale.name %> |
<% menu_cat_arr.push(sale.name) %>
<% else %>
|
<% end %>
<%= sale.product_name %> |
<%= sale.product_code %> |
<%= sale.qty.to_i %> |
<%= sale.unit_price %> |
<%= sale.price %> |
<% end %>
<% count = count + 1 %>
<% if sale.sale_items.count == count %>
|
Total Qty: |
<%= waste_and_spoil_item_count %>
<% waste_and_spoil_item_count = 0%>
|
Grand Total: |
<%= sale.grand_total %>
|
<% footer_arr.push(sale.sale_id) %>
<% end %>
<% end %>