diff --git a/app/views/reports/order_reservation/index.html.erb b/app/views/reports/order_reservation/index.html.erb index b59dc3db..439e7772 100755 --- a/app/views/reports/order_reservation/index.html.erb +++ b/app/views/reports/order_reservation/index.html.erb @@ -57,6 +57,7 @@ <%= 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") %> + <%= t("views.right_panel.detail.transaction_fee") %> @@ -88,6 +89,7 @@ total_tax = 0.0 total_amount = 0.0 grand_total = 0.0 + transaction_fee = 0.0 %> <% unless @order_reservation_data.blank? %> <% @order_reservation_data.each do |order_reservation| %> @@ -117,6 +119,9 @@ 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 %> <% if order_reservation.provider == 'pick_up' provider = "Pick-Up" @@ -149,6 +154,7 @@ <%= number_with_precision(commercial_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 end %> @@ -164,6 +170,7 @@ <%= number_with_precision(total_commercial_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'%> diff --git a/app/views/reports/order_reservation/index.xls.erb b/app/views/reports/order_reservation/index.xls.erb index d5617225..bb444043 100755 --- a/app/views/reports/order_reservation/index.xls.erb +++ b/app/views/reports/order_reservation/index.xls.erb @@ -40,6 +40,7 @@ <%= 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") %> + <%= t("views.right_panel.detail.transaction_fee") %> @@ -61,6 +62,7 @@ total_tax = 0.0 total_amount = 0.0 grand_total = 0.0 + transaction_fee = 0.0 %> <% unless @order_reservation_data.blank? %> <% @order_reservation_data.each do |order_reservation| %> @@ -91,6 +93,9 @@ 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 %> <% if order_reservation.provider == 'pick_up' provider = "Pick-Up" @@ -123,6 +128,7 @@ <%= commercial_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' %> <% end end %> @@ -138,6 +144,7 @@ <%= total_commercial_tax rescue '0.0'%> <%= total_tax rescue '0.0'%> <%= grand_total rescue '0.0'%> + <%= transaction_fee rescue '0.0'%> diff --git a/config/locales/en.yml b/config/locales/en.yml index 66e35892..689a1890 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -491,6 +491,7 @@ en: induty_report: "Induty Report" in_time: "In Time" out_time: "Out Time" + transaction_fee: "Transaction Fee" code_txt: "code " charge_txt: "charge" diff --git a/config/locales/mm.yml b/config/locales/mm.yml index 3aa5cb09..111cca55 100644 --- a/config/locales/mm.yml +++ b/config/locales/mm.yml @@ -485,6 +485,7 @@ mm: induty_report: "Induty Report" in_time: "In Time" out_time: "Out Time" + transaction_fee: "Transaction Fee" code_txt: "ကုတ်ဒ် " charge_txt: "ကောက်ခံသည်" diff --git a/db/migrate/20180406080240_create_order_reservations.rb b/db/migrate/20180406080240_create_order_reservations.rb index a343958f..f5a46dd2 100644 --- a/db/migrate/20180406080240_create_order_reservations.rb +++ b/db/migrate/20180406080240_create_order_reservations.rb @@ -19,6 +19,7 @@ class CreateOrderReservations < ActiveRecord::Migration[5.1] t.decimal :discount_amount, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :convenience_charge, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :grand_total, :precision => 10, :scale => 2, :null => false, :default => 0.00 + t.decimal :transaction_fee, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.string :status, :null => false, :default => "new" t.string :order_remark t.string :remark