<% 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%> <% table_name=nil table_type =nil if result.table_id.to_i>0 table = DiningFacility.find(result.table_id) table_type = table.type table_name = table.name end %> <% 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 = SalePayment.get_sale_payments(result) %> <% 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.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.detail.shift_name") %> <%= t("views.right_panel.detail.table") %> <%= t("views.right_panel.detail.receipt_no") %> <%= t :cashier %> <%= t("views.right_panel.detail.name") %> <%= t("views.right_panel.detail.revenue") %>  
<%= @shift_from %> - <%= @shift_to %> <%= table_type %> - <%= table_name %> <%= result.receipt_no rescue '-' %> <%= result.cashier_name rescue '-' %> <%=result.grand_total%>
<%= 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") %> <%= t("views.right_panel.detail.created_at") %>
<% 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 '-' %> <%=l item.created_at.utc.getlocal, :format => :short 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_amount %> ( <%= result.payment_status %> )  
    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 '-'%> (<%= result.customer.company rescue '-' %>)  
      Total Nett - <%= grand_total %>