change format

This commit is contained in:
phyusin
2018-08-03 15:46:59 +06:30
parent b1d0bf8daa
commit 27271c429e
5 changed files with 39 additions and 30 deletions

View File

@@ -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
%>
<tr style="border-top:2px solid #000">
@@ -187,6 +189,13 @@
<td colspan="4"><%= number_with_precision(grand_total, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
</tr>
<% end %>
<% if total_transaction_fee > 0 %>
<tr style="border-top:2px solid #000">
<td colspan="2" style="text-align:center"></td>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.transaction_fee") %></td>
<td colspan="4"><%= number_with_precision(total_transaction_fee, precision:precision.to_i, delimiter:delimiter) rescue ' '%></td>
</tr>
<% end %>
</tbody>
</table>
</div>