<% breadcrumb_add t("views.right_panel.detail.receipt_no_report"), "", dashboard_path %>
<%= render :partial=>'shift_sale_report_filter', :locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_detail_index_path} %>
<% 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 + result.grand_total %> <% result.sale_items.each do |item|%> <% end %> <%survey = result.survey%> <% if !survey.nil?%> <% end %> <% if !result.total_amount.nil?%> <% end %> <% if result.total_discount > 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 > 0 %> <% if !rec.payment_reference.nil? %> <% end %> <% end %> <% end %> <% if result.amount_changed != 0 %> <% 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.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 < 0 %> <% if item.qty < 0 %> [PROMO QTY]<%= item.product_name rescue '-' %> <% else %> [PROMO PRICE]<%= item.product_name rescue '-' %> <% end %> <% else %> <%= item.product_name rescue '-' %> <% end %> <%= item.qty rescue '-' %> <%= number_format(item.unit_price, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) rescue '-' %> <%= number_format(item.price, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) rescue '-' %>
 
      No. of Guest <%= survey.total_customer rescue '-' %>  
      <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %> <%= number_format(result.total_amount, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) %>  
      <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> - <%= number_format(result.total_discount, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) %>  
      Tax Amount <%= number_format(result.total_tax, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) %>  
      Payment <%= rec.payment_method.upcase %> ( <%= rec.payment_status %> ) <%= number_format(rec.payment_amount, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) %>  
      Payment Ref. <%= rec.payment_reference %>  
      <%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %> <%= number_format(result.amount_changed, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) %>  
      Customer <%= result.customer_name rescue '-'%> <% if result.customer_company.present? %> (<%= result.customer_company rescue '-' %>) <% end %>  
 
        Total Nett - <%= number_format(grand_total, precision: precision, delimiter: delimiter, strip_insignificant_zeros: strip_insignificant_zeros) %>