diff --git a/app/models/order_reservation.rb b/app/models/order_reservation.rb
index 5fdc9643..9fbc7e4d 100644
--- a/app/models/order_reservation.rb
+++ b/app/models/order_reservation.rb
@@ -70,7 +70,7 @@ class OrderReservation < ApplicationRecord
order_reservation.discount_amount = order_reserve[:payment_info][:discount_amount]
order_reservation.convenience_charge = order_reserve[:payment_info][:convenience_charge]
order_reservation.grand_total = order_reserve[:payment_info][:grand_total]
- order_reservation.transaction_fee = order_reserve[:order_info][:transaction_fee]
+ order_reservation.transaction_fee = order_reserve[:payment_info][:transaction_fee]
order_reservation.order_remark = order_reserve[:order_info][:order_remark]
end
if order_reserve[:reservation_info]
diff --git a/app/views/reports/order_reservation/index.html.erb b/app/views/reports/order_reservation/index.html.erb
index 439e7772..0ccaef5b 100755
--- a/app/views/reports/order_reservation/index.html.erb
+++ b/app/views/reports/order_reservation/index.html.erb
@@ -52,9 +52,9 @@
<%= 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.total") %> <%= t("views.right_panel.detail.tax") %> |
<%= t("views.right_panel.detail.grand_total") %> |
<%= t("views.right_panel.detail.transaction_fee") %> |
@@ -89,7 +89,7 @@
total_tax = 0.0
total_amount = 0.0
grand_total = 0.0
- transaction_fee = 0.0
+ total_transaction_fee = 0.0
%>
<% unless @order_reservation_data.blank? %>
<% @order_reservation_data.each do |order_reservation| %>
@@ -118,11 +118,9 @@
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.transaction_fee && order_reservation.transaction_fee > 0
- transaction_fee += order_reservation.transaction_fee.to_f
- end %>
- <%
+
+ total_transaction_fee += order_reservation.transaction_fee.to_f
+
if order_reservation.provider == 'pick_up'
provider = "Pick-Up"
elsif order_reservation.provider == 'direct_delivery'
@@ -149,9 +147,9 @@
<%= number_with_precision(discount_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(delivery_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(convenience_charge , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
- <%= number_with_precision(delivery_tax , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
+
<%= number_with_precision(order_reservation.total_tax , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(order_reservation.grand_total , precision:precision.to_i, delimiter:delimiter) rescue '0.0' %> |
<%= number_with_precision(order_reservation.transaction_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0' %> |
@@ -165,12 +163,12 @@
<%= number_with_precision(total_discount_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(total_delivery_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(total_convenience_charge , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
- <%= number_with_precision(total_delivery_tax , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
+
+ <%= number_with_precision(total_tax , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(grand_total , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
- <%= number_with_precision(transaction_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
+ <%= number_with_precision(total_transaction_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
diff --git a/app/views/reports/order_reservation/index.xls.erb b/app/views/reports/order_reservation/index.xls.erb
index bb444043..08f2c5e9 100755
--- a/app/views/reports/order_reservation/index.xls.erb
+++ b/app/views/reports/order_reservation/index.xls.erb
@@ -35,9 +35,9 @@
<%= 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.total") %> <%= t("views.right_panel.detail.tax") %> |
<%= t("views.right_panel.detail.grand_total") %> |
<%= t("views.right_panel.detail.transaction_fee") %> |
@@ -123,9 +123,9 @@
<%= discount_amount rescue '0.0'%> |
<%= delivery_fee rescue '0.0'%> |
<%= convenience_charge rescue '0.0'%> |
- <%= delivery_tax rescue '0.0'%> |
+
<%= order_reservation.total_tax rescue '0.0'%> |
<%= order_reservation.grand_total rescue '0.0' %> |
<%= order_reservation.transaction_fee rescue '0.0' %> |
@@ -139,9 +139,9 @@
<%= 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_tax rescue '0.0'%> |
<%= grand_total rescue '0.0'%> |
<%= transaction_fee rescue '0.0'%> |
diff --git a/app/views/transactions/order_reservations/index.html.erb b/app/views/transactions/order_reservations/index.html.erb
index f8063fd2..3766f092 100644
--- a/app/views/transactions/order_reservations/index.html.erb
+++ b/app/views/transactions/order_reservations/index.html.erb
@@ -11,10 +11,10 @@
-
+
- |
+ |
<%= form_tag transactions_order_reservations_path, :method => :get do %>
@@ -65,7 +65,7 @@
-
+
@@ -81,11 +81,12 @@
| <%= 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.total") %> <%= t("views.right_panel.detail.tax") %> |
<%= t("views.right_panel.detail.grand_total") %> |
+ <%= t("views.right_panel.detail.transaction_fee") %> |
@@ -152,16 +153,17 @@
<%= number_with_precision(discount_amount , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(delivery_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(convenience_charge , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
- <%= number_with_precision(delivery_tax , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
+
<%= number_with_precision(order_reservation.total_tax , precision:precision.to_i, delimiter:delimiter) rescue '0.0'%> |
<%= number_with_precision(order_reservation.grand_total , precision:precision.to_i, delimiter:delimiter) rescue '0.0' %> |
+ <%= number_with_precision(order_reservation.transaction_fee , precision:precision.to_i, delimiter:delimiter) rescue '0.0' %> |
<% end %>
<% else %>
- There is no data for search.... |
+ There is no data for search.... |
<% end %>
diff --git a/app/views/transactions/order_reservations/show.html.erb b/app/views/transactions/order_reservations/show.html.erb
index 7ab06b0c..a0c59af5 100755
--- a/app/views/transactions/order_reservations/show.html.erb
+++ b/app/views/transactions/order_reservations/show.html.erb
@@ -99,12 +99,13 @@
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).empty?
+ 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]
@@ -124,6 +125,7 @@
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
%>
@@ -187,6 +189,13 @@
| <%= number_with_precision(grand_total, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
<% end %>
+ <% if total_transaction_fee > 0 %>
+
+ |
+ <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.transaction_fee") %> |
+ <%= number_with_precision(total_transaction_fee, precision:precision.to_i, delimiter:delimiter) rescue ' '%> |
+
+ <% end %>
|