<%= render :partial=>'shift_sale_report_filter', :locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_hourly_saleitem_index_path} %>
<% time_arr = Array.new %> <% sale_item_count =0 %> <% menu_cat_arr = Array.new %> <% footer_arr = Array.new %> <% count = 0 %> <% waste_and_spoil_item_count = 0%> <% total_qty = 0 %> <% time_count = 0 %> <% @sale_data.each do |sale| %> <% if !time_arr.include?(sale.date_format) %> <% sale_item_count =1 %> <% time_count = time_count + 1 %> <% time_arr.push(sale.date_format) %> <% menu_cat_arr.clear %> <% count = 0 %> <% else %> <%= time_arr %> <% sale_item_count =sale_item_count +1 %> <% end %> <% 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 total_qty += sale.total_item end %> <% if sale.status_type == "Discount" total_qty += sale.total_item*(-1) end %> <% if sale.status_type =="promotion" && @type == "promotion" total_qty += sale.total_item*(-1) end %> <% if !sale.item_code.nil?%> <% waste_and_spoil_item_count += sale.qty.to_i %> <% if !menu_cat_arr.include?(sale.menu_category_name) %> <% menu_cat_arr.push(sale.menu_category_name) %> <% else %> <% end %> <% end %> <% count = count + 1 %> <% @hourly_total_qty.each do |hr| %> <% if hr["date"].to_s == sale.date_format.to_s && hr["total_qty"].to_i ==sale_item_count%> <% footer_arr.push(sale.sale_id) %> <% total_qty =0%> <% end %> <% end %> <% end %>
 
Time :<%= sale.date_format %> Date :
Menu Category Item Code Item Name Qty Price Total Price
<%= sale.menu_category_name %> <%= sale.item_code %> <%= sale.product_name %> <%= sale.total_item.to_i %> <%= sale.unit_price %> <%= sale.price %> <%= sale.date_format %>
  Total Qty: <%= total_qty%> Grand Total: