add dinga payment and new payment type in report

This commit is contained in:
phyusin
2018-04-09 09:40:08 +06:30
parent 785fbe20ed
commit 2e19d34ced
19 changed files with 543 additions and 122 deletions

View File

@@ -34,6 +34,11 @@
<th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.visa_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.jcb_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.unionpay_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.alipay_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.paymal_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.dinga_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.junctionpay_sales") %></th>
<th style='text-align:center;'><%= t("views.right_panel.detail.redeem_sales") %></th>
<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>
@@ -64,6 +69,11 @@
<% master = 0 %>
<% visa = 0 %>
<% jcb = 0 %>
<% unionpay = 0 %>
<% alipay = 0 %>
<% paymal = 0 %>
<% dinga = 0 %>
<% junctionpay = 0 %>
<% paypar = 0 %>
<% cash = 0 %>
<% credit = 0 %>
@@ -79,6 +89,11 @@
<% master += sale[:master_amount] %>
<% visa += sale[:visa_amount] %>
<% jcb += sale[:jcb_amount] %>
<% unionpay += sale[:unionpay_amount] %>
<% alipay += sale[:alipay_amount] %>
<% paymal += sale[:paymal_amount] %>
<% dinga += sale[:dinga_amount] %>
<% junctionpay += sale[:junctionpay_amount] %>
<% paypar += sale[:paypar_amount] %>
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
<% credit += sale[:credit_amount] %>
@@ -96,6 +111,11 @@
<td style='text-align:right;'><%= number_with_precision(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<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>
@@ -114,6 +134,11 @@
<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(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>
<td style='text-align:right;'><%= number_with_precision(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_with_precision(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<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>
@@ -129,7 +154,7 @@
<% @tax.each do |tax| %>
<% total_tax += tax.tax_amount.to_f %>
<tr style="font-weight:600;">
<td colspan="12" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
<td colspan="17" 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>
@@ -137,7 +162,7 @@
<% end %>
<% net = total - total_tax %>
<tr style="font-weight:600;">
<td colspan="12" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
<td colspan="17" 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>