<%= 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' %>
| Menu Category |
Item Name |
Item Code |
Qty |
Price |
Total Price |
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
precision = 0
end
#check delimiter
if @print_settings.delimiter
delimiter = ","
else
delimiter = ""
end
%>
<% receipt_arr = Array.new %>
<% menu_cat_arr = Array.new %>
<% footer_arr = Array.new %>
<% count = 0 %>
<% waste_and_spoil_item_count = 0%>
<% grand_total = 0%>
<% unless @sale_data.blank? %>
<% @sale_data.each do |sale| %>
<% if !sale.item_instance_code.nil?%>
<% waste_and_spoil_item_count += sale.qty.to_i %>
<% grand_total += sale.grand_total.to_i %>
<% end %>
<% if !menu_cat_arr.include?(sale.name) %>
| <%= sale.name %> |
<% menu_cat_arr.push(sale.name) %>
<% else %>
|
<% end %>
<%= sale.product_name %> |
<%= sale.product_code.to_i %> |
<%= sale.qty.to_i %> |
<%= number_with_precision(sale.unit_price, precision:precision.to_i,delimiter:delimiter) %> |
<%= number_with_precision(sale.price, precision:precision.to_i,delimiter:delimiter) %> |
<% count = count + 1 %>
<% if @sale_data.length == count %>
|
Total Qty: |
<%= number_with_precision(waste_and_spoil_item_count, precision:precision.to_i,delimiter:delimiter) %>
<% waste_and_spoil_item_count = 0%>
|
Grand Total: |
<%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) %>
|
<% footer_arr.push(sale.sale_id) %>
<% end %>
<% end %>
<% end %>