add transaction fee for order reservation

This commit is contained in:
phyusin
2018-07-30 17:20:04 +06:30
parent ca14b1e399
commit 01783c2707
5 changed files with 17 additions and 0 deletions

View File

@@ -40,6 +40,7 @@
<th><%= t("views.right_panel.detail.commercial_tax") %></th>
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th><%= t("views.right_panel.detail.transaction_fee") %></th>
</tr>
</thead>
<tbody>
@@ -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 @@
<td><%= commercial_tax rescue '0.0'%></td>
<td><%= order_reservation.total_tax rescue '0.0'%></td>
<td><%= order_reservation.grand_total rescue '0.0' %></td>
<td><%= order_reservation.transaction_fee rescue '0.0' %></td>
</tr>
<% end
end %>
@@ -138,6 +144,7 @@
<td><b><%= total_commercial_tax rescue '0.0'%></b></td>
<td><b><%= total_tax rescue '0.0'%></b></td>
<td><b><%= grand_total rescue '0.0'%></b></td>
<td><b><%= transaction_fee rescue '0.0'%></b></td>
</tr>
</tbody>
</table>