<% @order_reservation.order_reservation_items.each do |item| %> <% 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 total_transaction_fee = 0.0 %> <% discount_amount = @order_reservation.discount_amount delivery_fee = @order_reservation.delivery_fee ? @order_reservation.delivery_fee : 0.0 convenience_charge = @order_reservation.convenience_charge if !JSON.parse(@order_reservation.taxes).nil? && !JSON.parse(@order_reservation.taxes).empty? 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 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 total_transaction_fee += @order_reservation.transaction_fee.to_f %> <% if total_discount_amount > 0 %> <% end %> <% if total_delivery_fee > 0 %> <% end %> <% if total_convenience_charge > 0 %> <% end %> <% if total_tax > 0 %> <% end %> <% if grand_total > 0 %> <% end %> <% if total_transaction_fee > 0 %> <% end %>
<%= t :reference_number %> <%= t("views.right_panel.detail.type") %> <%= t("views.right_panel.detail.requested_time") %> <%= t("views.right_panel.detail.cooking_time") %> <%= t("views.right_panel.detail.status") %> <%= t :payment %> <%= t("views.right_panel.detail.type") %> <%= t("views.right_panel.detail.remark") %>
<%= @order_reservation.transaction_ref %> <%= @order_reservation.order_reservation_type %> <%= @order_reservation.requested_time.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %> <%= @order_reservation.expected_waiting_time rescue '-' %> <%= @order_reservation.status %> <%= @order_reservation.payment_type %> <%= @order_reservation.order_remark ? @order_reservation.order_remark : @order_reservation.reservation_remark %>
<%= t :sale %> <%= t("views.right_panel.detail.item_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <%= 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") %>
<%=item.item_name rescue ' '%> <%=item.qty rescue ' '%> <%= number_format(item.price > 0 ? item.price : item.unit_price, precision:precision.to_i, delimiter:delimiter) rescue ' '%> <%= number_format(item.price > 0 ? item.qty * item.price : item.qty * item.unit_price, precision:precision.to_i, delimiter:delimiter) rescue ' '%> <%=l item.created_at.utc.getlocal , :format => :short rescue ' ' %>
<%= t("views.right_panel.detail.sub_total") %> <%= number_format(total_amount, precision:precision.to_i, delimiter:delimiter) rescue ' '%>
<%= t("views.right_panel.detail.discount_amount") %> <%= number_format(total_discount_amount, precision:precision.to_i, delimiter:delimiter) rescue ' '%>
<%= t("views.right_panel.detail.delivery_fee") %> <%= number_format(total_delivery_fee, precision:precision.to_i, delimiter:delimiter) rescue ' '%>
<%= t("views.right_panel.detail.convenience_charge") %> <%= number_format(total_convenience_charge, precision:precision.to_i, delimiter:delimiter) rescue ' '%>
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> <%= number_format(total_tax, precision:precision.to_i, delimiter:delimiter) rescue ' '%>
<%= t("views.right_panel.detail.grand_total") %> <%= number_format(grand_total, precision:precision.to_i, delimiter:delimiter) rescue ' '%>
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.transaction_fee") %> <%= number_format(total_transaction_fee, precision:precision.to_i, delimiter:delimiter) rescue ' '%>
<% if !@customer.nil? %> <% end %>
<%= t("views.right_panel.detail.name") %> <%= t("views.right_panel.detail.company") %> <%= t("views.right_panel.detail.contact_no") %> <%= t("views.right_panel.detail.email") %> <%= t("views.right_panel.detail.nrc_passport_no") %> <%= t("views.right_panel.detail.address") %> <%= t("views.right_panel.detail.dob") %>
<%= @customer.name %> <%= @customer.company rescue '-' %> <%= @customer.contact_no %> <%= @customer.email %> <%= @customer.nrc_no %> <%= @customer.address%> <%= @customer.date_of_birth %>
<% if !@delivery.nil? %> <% if @delivery.provider == 'pick_up' provider = "Pick-Up" elsif @delivery.provider == 'direct_delivery' provider = "Direct Delivery" elsif @delivery.provider == 'turbo' provider = "TURBO" else provider = @delivery.provider end %> <% end %>
<%= t("views.right_panel.detail.provider") %> <%= t("views.right_panel.detail.delivery_type") %> <%= t("views.right_panel.detail.address") %> <%= t("views.right_panel.detail.township") %>
<%= provider%> <%= @delivery.delivery_type%> <%= @delivery.address%> <%= @delivery.township%>