<% if @shift_from %> <% if @shift_data.employee %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% end %> <% end %> <% grand_total = 0 %> <% @sale_data.each do |result| %> <% grand_total = grand_total.to_f + result.grand_total.to_f%> <% result.sale_items.each do |item|%> <% end %> <%survey = Survey.find_by_receipt_no(result.receipt_no)%> <% if !survey.nil?%> <% end %> <% if !result.total_amount.nil?%> <% end %> <% if result.total_discount.to_f > 0 %> <% end %> <% if !result.total_tax.nil? %> <% end %> <% sale_payments = result.sale_payments %> <% if sale_payments.length > 0%> <% sale_payments.each do |rec| %> <%if rec.payment_amount.to_f > 0 %> <% if !rec.payment_reference.nil? %> <% end %> <% end %> <% end %> <% if result.amount_changed != 0 && !result.amount_changed.nil? %> <% end %> <% if !result.customer_id.nil?%> <% end %> <% end %> <% end %>
<%= t("views.right_panel.detail.from_date") %> : <%= @from.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.strftime("%Y-%b-%d") rescue '-'%>
<%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
<%= t("views.right_panel.detail.receipt_no") %> <%= t("views.right_panel.detail.receipt_date") %> <%= t("views.right_panel.detail.shift_name") %> <%= t :cashier %> <%= t("views.right_panel.detail.table") %> <%= t("views.right_panel.detail.revenue") %>  
<%= result.receipt_no rescue '-' %> <%=l result.receipt_date.getlocal, :format => :short rescue '-' %> <%= @shift_from %> - <%= @shift_to %> <%= result.cashier_name rescue '-' %> <%= result.table_type %> - <%= result.table_name %> <%= number_format(result.grand_total, precision: precision, delimiter: delimiter) %>
  <%= t("views.right_panel.detail.product") %> <%= t("views.right_panel.detail.qty") %> <%= t("views.right_panel.detail.unit_price") %> <%= t("views.right_panel.detail.total_price") %>
  <% if item.price.to_i < 0.to_i %> <% if item.qty.to_i < 0.to_i%> [PROMO QTY]<%= item.product_name rescue '-' %> <% else %> [PROMO PRICE]<%= item.product_name rescue '-' %> <% end %> <% else %> <%= item.product_name rescue '-' %> <% end %> <%= item.qty rescue '-' %> <%= item.unit_price rescue '-' %> <%= item.price rescue '-' %>
 
      No. of Guest <%= survey.total_customer rescue '-' %>  
      <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %> <%= result.total_amount %>  
      <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> - <%= result.total_discount %>  
      Tax Amount <%= result.total_tax %>  
      Payment <%= rec.payment_method.upcase %>( <%= rec.payment_status %> ) <%= rec.payment_amount %>  
      Payment Ref. <%= rec.payment_reference %>  
      <%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %> <%= result.amount_changed %>  
      Customer <%= result.customer_name rescue '-'%> <% if result.customer_company.present? %> (<%= result.customer_company rescue '-' %>) <% end %>  
 
        Total Nett - <%= grand_total %>