<% if @shift_from %> <% if @shift_data.employee %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% end %> <% end %> <% unless @sale_data.blank? %> <% acc_arr = Array.new %> <% cate_arr = Array.new %> <% sub_total = 0 %> <% other_sub_total = 0 %> <% count = 0 %> <% total_price = 0 %> <% cate_count = 0 %> <% acc_count = 0 %> <% grand_total = 0 %> <% total_qty = 0 %> <% total_amount = 0 %> <% discount = 0 %> <% total_item_foc = 0 %> <% total_item_dis = 0 %> <% @sale_data.each do |sale| %> <% if sale.total_item > 0 total_qty += sale.total_item end %> <% if !acc_arr.include?(sale.account_id) %> <% acc_arr.push(sale.account_id) %> <% end %> <% if !cate_arr.include?(sale.menu_category_id) %> <% cate_arr.push(sale.menu_category_id) %> <% else %> <% end %> <% @menu_cate_count.each do |key,value| %> <% if sale.menu_category_id == key %> <% count = count + 1 %> <% sub_total += sale.grand_total %> <% if count == value %> <% if sale.status_type === "foc" total_item_foc += sale.grand_total end %> <% if sale.status_type === "Discount" total_item_dis += sale.grand_total end %> <% sub_total = 0.0%> <% count = 0%> <% end %> <% end %> <% end %> <% end %> <% @other_charges.each do |other| %> <% if other.total_item > 0 total_qty += other.total_item end %> <% grand_total +=other.grand_total%> <% other_sub_total += other.grand_total %> <% end %> <% end %>
<%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
<%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
  <%= t("views.right_panel.header.menu_category") %> <%= t("views.right_panel.detail.code") %> <%= t("views.right_panel.detail.product") %> <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %> <%= t("views.right_panel.detail.unit_price") %> <%= t("views.right_panel.detail.revenue") %>
<%= sale.account_name %>   <%= t("views.right_panel.detail.total_price_by") %> <%= sale.account_name %> <% @totalByAccount.each do |account, total| %> <% if sale.account_id == account %> <%= total %> <% grand_total += total %> <% end %> <% end %>
 <%= sale.menu_category_name %> <%= sale.item_code rescue '-' %> <%= sale.product_name rescue '-' %> <%= sale.total_item rescue '-' %> <%= sale.unit_price rescue '-' %> <%= sale.grand_total rescue '-' %>
  <%= t("views.right_panel.detail.sub_total") %> <%= sub_total %>
Other Charges  
  Other Charges <%= other.item_code rescue '-' %> <%= other.product_name rescue '-' %> <%= other.total_item rescue '-' %> <%= other.unit_price rescue '-' %> <%= other.grand_total rescue '-' %>
  <%= t("views.right_panel.detail.sub_total") %> <%= other_sub_total %>
  <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %> <%= total_qty%> <%= t("views.right_panel.detail.net_amount") %> <%= grand_total%>
  <%= t("views.right_panel.detail.foc_item") %> <%= t("views.right_panel.detail.amount") %> <%= total_item_foc %>
  <%= t("views.right_panel.detail.item_discount") %> <%= t("views.right_panel.detail.amount") %> <%= total_item_dis %>
  <%= t("views.right_panel.detail.foc_sales") %> <%= @foc_data %>
  <%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> <%= @discount_data %>