<% if @shift_from %> <% if @shift_data.employee %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% end %> <% end %> <% discount_amount = 0.0 delivery_fee = 0.0 convenience_charge = 0.0 delivery_tax = 0.0 convenience_tax = 0.0 commercial_tax = 0.0 total_discount_amount = 0 total_delivery_fee = 0 total_convenience_charge = 0 total_delivery_tax = 0 total_convenience_tax = 0 total_commercial_tax = 0 total_tax = 0.0 total_amount = 0.0 grand_total = 0.0 %> <% unless @order_reservation_data.blank? %> <% @order_reservation_data.each do |order_reservation| %> <% provider = "" discount_amount = order_reservation.discount_amount delivery_fee = order_reservation.delivery_fee ? order_reservation.delivery_fee : 0.0 convenience_charge = order_reservation.convenience_charge JSON.parse(order_reservation.taxes).each do |tax_data| if tax_data[0] == "delivery_tax" delivery_tax = tax_data[1] elsif tax_data[0] == "convenience_tax" convenience_tax = tax_data[1] elsif tax_data[0] == "commercial_tax" commercial_tax = tax_data[1] end end total_discount_amount += discount_amount.to_f total_delivery_fee += delivery_fee.to_f total_convenience_charge += convenience_charge.to_f total_delivery_tax += delivery_tax.to_f total_convenience_tax += convenience_tax.to_f total_commercial_tax += commercial_tax.to_f total_tax += order_reservation.total_tax.to_f total_amount += order_reservation.total_amount.to_f grand_total += order_reservation.grand_total.to_f %> <% if order_reservation.provider == 'pick_up' provider = "Pick-Up" elsif order_reservation.provider == 'direct_delivery' provider = "Direct Delivery" else provider = order_reservation.provider 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 :customer %> <%= t("views.right_panel.detail.type") %> <%= t("views.right_panel.detail.requested_time") %> <%= t("views.right_panel.detail.provider") %> <%= t :payment_method %> <%= t :payment %> <%= t("views.right_panel.detail.status")%> <%= t("views.right_panel.detail.sub_total") %> <%= t("views.right_panel.detail.discount_amount") %> <%= t("views.right_panel.detail.delivery_fee") %> <%= t("views.right_panel.detail.convenience_charge") %> <%= t("views.right_panel.detail.delivery_tax") %> <%= t("views.right_panel.detail.convenience_tax") %> <%= t("views.right_panel.detail.commercial_tax") %> <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> <%= t("views.right_panel.detail.grand_total") %>
<%= order_reservation.email %> <%= order_reservation.order_reservation_type %> <%= order_reservation.requested_time.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %> <%= provider%> <%= order_reservation.payment_type%> <%= order_reservation.payment_status%> <%= order_reservation.total_amount rescue '0.0'%> <%= discount_amount rescue '0.0'%> <%= delivery_fee rescue '0.0'%> <%= convenience_charge rescue '0.0'%> <%= delivery_tax rescue '0.0'%> <%= convenience_tax rescue '0.0'%> <%= commercial_tax rescue '0.0'%> <%= order_reservation.total_tax rescue '0.0'%> <%= order_reservation.grand_total rescue '0.0' %>
<%= total_amount rescue '0.0'%> <%= total_discount_amount rescue '0.0'%> <%= total_delivery_fee rescue '0.0'%> <%= total_convenience_charge rescue '0.0'%> <%= total_delivery_tax rescue '0.0'%> <%= total_convenience_tax rescue '0.0'%> <%= total_commercial_tax rescue '0.0'%> <%= total_tax rescue '0.0'%> <%= grand_total rescue '0.0'%>