fixed conflict

This commit is contained in:
Nweni
2019-11-28 14:19:37 +06:30
90 changed files with 3237 additions and 3284 deletions

View File

@@ -24,7 +24,7 @@
<table class="table table-bordered">
<thead>
<tr>
<th colspan="18"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
<th colspan="<%= column_count = @payment_methods.length + 8 %>"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
</tr>
<% @count = 1 %>
<% @payment_methods.each_slice(10) do |slice| %>
@@ -46,7 +46,6 @@
<th style="text-align:center;"><%= alph = alph.ord.next.chr %></th>
<th style="text-align:center;"><%= alph = alph.ord.next.chr %></th>
<th style="text-align:center;"><%= alph = alph.ord.next.chr %></th>
<th style="text-align:center;"><%= alph = alph.ord.next.chr %></th>
</tr>
<!-- <tr>
<th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
@@ -127,18 +126,6 @@
</tr>
</thead>
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
precision = 0
end
#check delimiter
if @print_settings.delimiter
delimiter = ","
else
delimiter = ""
end
%>
<% unless @sale_data.blank? %>
<tbody>
<% void = 0 %>
@@ -188,50 +175,50 @@
<td style='text-align:right;'><%= count %></td>
<td><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %></td>
<% if @payment_methods.include? ("MPU") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Master") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("VISA") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("JCB") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("UNIONPAY") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Alipay") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("KBZPay") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:kbzpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:kbzpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("PAYMAL") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("DINGA") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("JunctionPay") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Redeem") %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("GiftVoucher") %>
<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_format(sale[:giftvoucher_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<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='color:red;text-align:right;'><%= number_with_precision(sale[:void_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_format(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='color:red;text-align:right;'><%= number_format(sale[:void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(sale[:foc_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[: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>
<td style='text-align:right;'>(<%= number_format(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)</td>
<!-- <td style='text-align:right;'><%= number_format(sale[:grand_total].to_f + sale[:rounding_adj].to_f , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
<td style='text-align:right;'><%= number_format(sale[:rounding_adj].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(sale[:grand_total], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<% count = count + 1 %>
@@ -243,83 +230,85 @@
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end%>
<% if @payment_methods.include? ("Master") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end%>
<% if @payment_methods.include? ("VISA") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end%>
<% if @payment_methods.include? ("JCB") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end%>
<% if @payment_methods.include? ("UNIONPAY") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Alipay") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("KBZPay") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(kbzpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(kbzpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("PAYMAL") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("DINGA") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("JunctionPay") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("Redeem") %>
<% if !request.user_agent.include? "Mobile" %>
<% colspan += 1 %>
<% end %>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_format(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<% if @payment_methods.include? ("GiftVoucher") %>
<% colspan += 1 %>
<td style='text-align:right;'><%= number_with_precision(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<% end %>
<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='color:red;text-align:right;'><%= number_with_precision(void, precision:precision.to_i,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_format(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='color:red;text-align:right;'><%= number_format(void, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(foc, 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(rounding_adj, 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>
<td style='text-align:right;'>(<%= number_format(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)</td>
<td style='text-align:right;'><%= number_format(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td style='text-align:right;'><%= number_format(grand_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<tr style="font-weight:600;">
<td colspan="<%= column_count %>">&nbsp;</td>
</tr>
<% total_tax = 0 %>
<% net = 0 %>
<% unless @tax.blank? %>
@@ -327,8 +316,7 @@
total_tax += tax.tax_amount.to_f %>
<tr style="font-weight:600;">
<td colspan="<%= colspan %>" 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>
<td colspan="2" style='text-align:right;'><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
<% end %>
<% end %>
@@ -338,8 +326,7 @@
<% net = net - total_tax %>
<tr style="font-weight:600;">
<td colspan="<%= colspan %>" 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>
<td colspan="2" style='text-align:right;'><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr>
</tbody>
<% end %>