| <%= @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") %> |
|
|
<% @order_reservation.order_reservation_items.each do |item| %>
| <%=item.item_name rescue ' '%> |
<%=item.qty rescue ' '%> |
<%= number_with_precision(item.price > 0 ? item.price : item.unit_price, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
<%= number_with_precision(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 ' ' %> |
|
|
<% 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
%>
<%
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).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
%>
|
<%= t("views.right_panel.detail.sub_total") %> |
<%= number_with_precision(total_amount, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
<% if total_discount_amount > 0 %>
|
<%= t("views.right_panel.detail.discount_amount") %> |
<%= number_with_precision(total_discount_amount, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
<% end %>
<% if total_delivery_fee > 0 %>
|
<%= t("views.right_panel.detail.delivery_fee") %> |
<%= number_with_precision(total_delivery_fee, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
<% end %>
<% if total_convenience_charge > 0 %>
|
<%= t("views.right_panel.detail.convenience_charge") %> |
<%= number_with_precision(total_convenience_charge, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
<% end %>
<% if total_tax > 0 %>
|
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> |
<%= number_with_precision(total_tax, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
<% end %>
<% if grand_total > 0 %>
|
<%= t("views.right_panel.detail.grand_total") %> |
<%= number_with_precision(grand_total, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
<% end %>