add new payment for aston request

This commit is contained in:
phyusin
2018-05-29 14:29:38 +06:30
parent 089630616d
commit 930e8d29d5
16 changed files with 397 additions and 40 deletions

View File

@@ -43,6 +43,7 @@
<th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.foc_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.giftvoucher_sales") %></th>
<th style='text-align:center;'>(<%= t("views.right_panel.detail.discount") %>)</th>
<!-- <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %> + <br/> <%= t("views.right_panel.detail.rnd_adj_sh") %></th> -->
<th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
@@ -75,6 +76,7 @@
<% paymal = 0 %>
<% dinga = 0 %>
<% junctionpay = 0 %>
<% giftvoucher = 0 %>
<% paypar = 0 %>
<% cash = 0 %>
<% credit = 0 %>
@@ -95,6 +97,7 @@
<% paymal += sale[:paymal_amount] %>
<% dinga += sale[:dinga_amount] %>
<% junctionpay += sale[:junctionpay_amount] %>
<% giftvoucher += sale[:giftvoucher_amount] %>
<% paypar += sale[:paypar_amount] %>
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
<% credit += sale[:credit_amount] %>
@@ -121,6 +124,7 @@
<td style='text-align:right;'><%= number_with_precision(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:giftvoucher_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'>(<%= number_with_precision(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)</td>
<!-- <td style='text-align:right;'><%= number_with_precision(sale[:grand_total].to_f + sale[:rounding_adj].to_f , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
<td style='text-align:right;'><%= number_with_precision(sale[:grand_total], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
@@ -129,12 +133,11 @@
</tr>
<% count = count + 1 %>
<% end %>
<tr style="font-weight:600;">
<td colspan="3" style='text-align:center;'>Total</td>
<td style='text-align:right;'><%= number_with_precision(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(visa, precision:precision,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
@@ -144,7 +147,8 @@
<td style='text-align:right;'><%= number_with_precision(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(foc, precision:precision,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'>(<%= number_with_precision(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)</td>
<!-- <td style='text-align:right;'><%= number_with_precision(total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
<td style='text-align:right;'><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
@@ -157,7 +161,7 @@
<% @tax.each do |tax|
total_tax += tax.tax_amount.to_f %>
<tr style="font-weight:600;">
<td colspan="17" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
<td colspan="18" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td colspan="2">&nbsp;</td>
</tr>
@@ -168,7 +172,7 @@
<% net = net - rounding_adj%>
<% net = net - total_tax %>
<tr style="font-weight:600;">
<td colspan="17" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td colspan="18" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td style='text-align:right;'><%= number_with_precision(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td colspan="2">&nbsp;</td>
</tr>