number with precision in receipt report excel.
This commit is contained in:
@@ -26,10 +26,58 @@
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<% @payment_methods.each_slice(10) do |slice| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<% alph = "A" %>
|
||||
<% @count = 1 %>
|
||||
<% slice.each do |payment_method| %>
|
||||
<th style="text-align:center;">
|
||||
<%= alph %>
|
||||
</th>
|
||||
<% alph = alph.ord.next.chr %>
|
||||
<% @count += 1 %>
|
||||
<% end %>
|
||||
<th style="text-align:center;" ><%= alph %></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>
|
||||
<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>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.date") %></th>
|
||||
<% slice.each do |payment_method| %>
|
||||
<th style="text-align:center;">
|
||||
<%= payment_method %>
|
||||
</th>
|
||||
<% end %>
|
||||
<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.void_amount") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.foc_sales") %></th>
|
||||
<% if @payment_methods.include? ("GiftVoucher") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.giftvoucher_sales") %></th>
|
||||
<% end %>
|
||||
<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.rnd_adj_sh") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
</tr> -->
|
||||
<% end %>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th colspan="<%= @count + 1 %>" style='text-align:center;'>Income</th>
|
||||
<th colspan=4 style='text-align:center;'>Outgoing</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.date") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
|
||||
<% if @payment_methods.include? ("MPU") %>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.mpu_sales") %></th>
|
||||
<% end %>
|
||||
@@ -63,16 +111,18 @@
|
||||
<% if @payment_methods.include? ("Redeem") %>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.redeem_sales") %></th>
|
||||
<% end %>
|
||||
<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>
|
||||
<% if @payment_methods.include? ("GiftVoucher") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.giftvoucher_sales") %></th>
|
||||
<% end %>
|
||||
<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.void_amount") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.foc_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>
|
||||
<!-- <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.rnd_adj_sh") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -137,7 +187,6 @@
|
||||
<tr>
|
||||
<td style='text-align:right;'><%= count %></td>
|
||||
<td><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %></td>
|
||||
<td style='color:red;text-align:right;'><%= number_with_precision(sale[:void_amount], precision:precision.to_i,delimiter:delimiter) 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>
|
||||
<% end %>
|
||||
@@ -171,23 +220,25 @@
|
||||
<% 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>
|
||||
<% 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='text-align:right;'><%= number_with_precision(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @payment_methods.include? ("GiftVoucher") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(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_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>
|
||||
<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>
|
||||
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
<% end %>
|
||||
<% colspan = 7 %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="3" style='text-align:center;'>Total</td>
|
||||
<td colspan="2" style='text-align:center;'>Total</td>
|
||||
<% if @payment_methods.include? ("MPU") %>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
@@ -254,17 +305,19 @@
|
||||
<% 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>
|
||||
<% 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='text-align:right;'><%= number_with_precision(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @payment_methods.include? ("GiftVoucher") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(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_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>
|
||||
<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>
|
||||
|
||||
</tr>
|
||||
<% total_tax = 0 %>
|
||||
|
||||
@@ -131,32 +131,28 @@
|
||||
<% num = 1 %>
|
||||
<% if tax_flag && tax_count > 0 %>
|
||||
<% while num <= tax_count %>
|
||||
<td>0</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% num += 1 %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<td>
|
||||
<%= number_with_precision(tax.tax_payable_amount, precision: precision.to_i, delimiter: delimiter) rescue '-' %>
|
||||
</td>
|
||||
<td><%= number_with_precision(tax.tax_payable_amount, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<%end%>
|
||||
<% num = 1 %>
|
||||
<% if !tax_flag && tax_count > 0 %>
|
||||
<% while num <= tax_count %>
|
||||
<td>0</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% num += 1 %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td>0</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% end %>
|
||||
<%end%>
|
||||
|
||||
<td><%= number_with_precision(result.grand_total - result.rounding_adjustment, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
|
||||
<td><%= number_with_precision(result.rounding_adjustment.to_f, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(result.grand_total, precision: precision.to_i, delimiter: delimiter) %></td>
|
||||
<td><%= number_with_precision(result.grand_total, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% if @lookup.value.to_i == 1 %>
|
||||
<td>
|
||||
<!-- ############### Need to Check SyncStatus ############# -->
|
||||
@@ -176,50 +172,30 @@
|
||||
<td colspan="3"> </td>
|
||||
<td><b><%= number_with_precision(total_sum, precision: precision.to_i, delimiter: delimiter) rescue '-' %></b></td>
|
||||
<td><b><%= number_with_precision(discount_amt, precision: precision.to_i, delimiter: delimiter) rescue '-' %></b></td>
|
||||
<!-- <% if !@sale_taxes.empty?
|
||||
@sale_taxes.each do |tax| %>
|
||||
<td>
|
||||
<b><%= number_with_precision(tax.st_amount, precision: precision.to_i, delimiter: delimiter) rescue '-' %></b>
|
||||
</td>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td><b>0</b></td>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
|
||||
<% if !@sale_taxes.empty? %>
|
||||
<% num = 1
|
||||
if ttax_flag && ttax_count > 0 %>
|
||||
<% while num <= ttax_count %>
|
||||
<td>
|
||||
<%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) %>
|
||||
</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) %></td>
|
||||
<% num += 1
|
||||
end %>
|
||||
<% end %>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td>
|
||||
<%= number_with_precision(tax.st_amount, precision: precision.to_i, delimiter: delimiter) rescue '-' %>
|
||||
</td>
|
||||
<td><%= number_with_precision(tax.st_amount, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<%end%>
|
||||
<% num = 1
|
||||
if ttax_flag==false && ttax_count > 0 %>
|
||||
<% while num <= ttax_count %>
|
||||
<td>
|
||||
<%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) %>
|
||||
</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) %></td>
|
||||
<% num += 1
|
||||
end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% end %>
|
||||
<%end%>
|
||||
|
||||
<td><b><%= number_with_precision(old_grand_total.to_f, precision: precision.to_i, delimiter: delimiter) rescue '0' %></b></td>
|
||||
|
||||
<td><b><%= number_with_precision(rounding_adj.to_f, precision: precision.to_i, delimiter: delimiter) rescue '-' %></b></td>
|
||||
<td><b><%= number_with_precision(grand_total.to_f, precision: precision.to_i, delimiter: delimiter) rescue '-' %></b></td>
|
||||
<td></td>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="9"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to ? @to.utc.getlocal.strftime("%Y-%b-%d") : '-'%></th>
|
||||
<th colspan="9"> <%= 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>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
@@ -22,7 +22,6 @@
|
||||
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.dining") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
@@ -41,8 +40,21 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% 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 %>
|
||||
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% after_rounding = 0 %>
|
||||
<% total_tax = 0 %>
|
||||
<% guest_count = 0 %>
|
||||
<% total_sum = 0 %>
|
||||
@@ -89,76 +101,66 @@
|
||||
</td>
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.total_amount rescue '-' %></td>
|
||||
<td><%= result.total_discount rescue '-' %></td>
|
||||
|
||||
<% if !result.sale_taxes.empty? %>
|
||||
<% num = 1
|
||||
if tax_flag && tax_count > 0 %>
|
||||
<% while num <= tax_count %>
|
||||
<td>0</td>
|
||||
<% num += 1
|
||||
end %>
|
||||
<td><%= number_with_precision(result.total_amount, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(result.total_discount, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% if !result.sale_taxes.empty? %>
|
||||
<% num = 1 %>
|
||||
<% if tax_flag && tax_count > 0 %>
|
||||
<% while num <= tax_count %>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% num += 1 %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<td>
|
||||
<%= tax.tax_payable_amount rescue '-' %>
|
||||
</td>
|
||||
<%end%>
|
||||
<% num = 1
|
||||
<td><%= number_with_precision(tax.tax_payable_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<% end %>
|
||||
<% num = 1
|
||||
if tax_flag==false && tax_count > 0 %>
|
||||
<% while num <= tax_count %>
|
||||
<td>0</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% num += 1
|
||||
end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td>0</td>
|
||||
<% end %>
|
||||
<%end%>
|
||||
|
||||
<td><%= result.grand_total - result.rounding_adjustment %></td>
|
||||
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= result.grand_total rescue '-'%></td>
|
||||
<% else %>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<% end %>
|
||||
<%end%>
|
||||
<td><%= number_with_precision(result.grand_total - result.rounding_adjustment, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(result.rounding_adjustment.to_f, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(result.grand_total, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;">
|
||||
<td colspan="3"> </td>
|
||||
<td><b><%= total_sum rescue '-'%></b></td>
|
||||
<td><b><%= discount_amt rescue '-'%></b></td>
|
||||
<!-- <% @sale_taxes.each do |tax| %>
|
||||
<td><b><%= tax.st_amount.round(2) %></b></td>
|
||||
<% end %> -->
|
||||
<td><b><%= number_with_precision(total_sum, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td>
|
||||
<td><b><%= number_with_precision(discount_amt, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></b></td>
|
||||
<% if !@sale_taxes.empty? %>
|
||||
<% num = 1
|
||||
if ttax_flag && ttax_count > 0 %>
|
||||
<% while num <= ttax_count %>
|
||||
<td>0.00</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% num += 1
|
||||
end %>
|
||||
<% end %>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td>
|
||||
<%= tax.st_amount.to_f.round(2) %>
|
||||
</td>
|
||||
<td><%= number_with_precision(tax.st_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<%end%>
|
||||
<% num = 1
|
||||
if ttax_flag==false && ttax_count > 0 %>
|
||||
<% while num <= ttax_count %>
|
||||
<td>0.00</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i, delimiter: delimiter) rescue '-' %></td>
|
||||
<% num += 1
|
||||
end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td>0.00</td>
|
||||
<td><%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<% end %>
|
||||
<%end%>
|
||||
<td><b><%= grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||
<td><b><%= rounding_adj rescue '-'%></b></td>
|
||||
<td><b><%= grand_total.to_f.round + rounding_adj %></b></td>
|
||||
<td><b><%= number_with_precision(old_grand_total.to_f, precision: precision.to_i, delimiter: delimiter) rescue '0' %></b></td>
|
||||
<td><b><%= number_with_precision(rounding_adj.to_f, precision: precision.to_i, delimiter: delimiter) rescue '-' %></b></td>
|
||||
<td><b><%= number_with_precision(grand_total.to_f, precision: precision.to_i, delimiter: delimiter) rescue '-' %></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
@@ -173,8 +175,10 @@
|
||||
<td><%= t("views.right_panel.detail.grand_total") %> +<br/>
|
||||
<%= t("views.right_panel.detail.rnd_adj_sh") %>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<%end%>
|
||||
<%end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -60,17 +60,17 @@
|
||||
</th>
|
||||
<%end%>
|
||||
<%end%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= @sale.receipt_date.strftime("%d-%M-%Y") %></td>
|
||||
<td><%= @sale.receipt_date.strftime("%d-%m-%Y") %></td>
|
||||
<td><%= @sale.receipt_no %></td>
|
||||
<td><%= @sale.cashier_name rescue '-' %></td>
|
||||
<td><%= @sale.sale_status %> </td>
|
||||
<td colspan="2"> <%= @sale.requested_at.strftime("%m-%d-%Y %H:%M %p") %> </td>
|
||||
</tr>
|
||||
<td colspan="2"> <%= @sale.requested_at.strftime("%d-%m-%Y %H:%M %p") %> </td>
|
||||
</tr>
|
||||
<tr style="border-top:2px solid #000">
|
||||
<th><%= t :sale %> <%= t("views.right_panel.detail.item_txt") %> <%= t("views.right_panel.detail.name_txt2") %></th>
|
||||
<th><%= t("views.right_panel.detail.qty") %></th>
|
||||
@@ -78,20 +78,20 @@
|
||||
<th><%= t("views.right_panel.detail.total_price") %></th>
|
||||
<th><%= t("views.right_panel.detail.created_at") %></th>
|
||||
<th><%= t("views.right_panel.detail.remark") %></th>
|
||||
</tr>
|
||||
</tr>
|
||||
<% @sale.sale_items.each do |s| %>
|
||||
<tr>
|
||||
<td><%=s.product_name rescue ' '%></td>
|
||||
<td><%=s.qty rescue ' '%></td>
|
||||
<td><%= number_with_precision(s.unit_price, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
<td><%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
<td><%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
<td><%=l s.created_at.utc.getlocal , :format => :short rescue ' ' %></td>
|
||||
<td><%=s.remark rescue ' '%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr style="border-top:2px solid #000">
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.total") %></td>
|
||||
<td><%= t("views.right_panel.detail.total") %></td>
|
||||
<td colspan="3"><%= number_with_precision(@sale.total_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -102,10 +102,10 @@
|
||||
<% @sale.sale_taxes.each do |r|%>
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= r.tax_name %> </td>
|
||||
<td><%= r.tax_name %> </td>
|
||||
<td colspan="3"><%= number_with_precision(r.tax_payable_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.grand_total") %></td>
|
||||
@@ -122,8 +122,8 @@
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td> <%= r.payment_method.capitalize rescue ' '%> Payment</td>
|
||||
<td colspan="3"><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td><%= t("views.right_panel.detail.change") %></td>
|
||||
@@ -208,7 +208,7 @@
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
|
||||
<% if @response["status"] == true %>
|
||||
<% @response["data"].each do |transaction| %>
|
||||
<tr>
|
||||
@@ -216,7 +216,7 @@
|
||||
<td><%= transaction["redeem"]%></td>
|
||||
<td><%= transaction["rebate"] %></td>
|
||||
<td><%= transaction["balance"] %></td>
|
||||
<td><%= transaction["account_status"] %></td>
|
||||
<td><%= transaction["account_status"] %></td>
|
||||
<td><%= transaction["status"] %></td>
|
||||
<td><%= transaction["receipt_no"] %></td>
|
||||
<td></td>
|
||||
@@ -241,13 +241,13 @@
|
||||
<th><%= t("views.right_panel.detail.remark") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody>
|
||||
<% @sale_audits.each do |audit| %>
|
||||
<tr>
|
||||
<td><%= audit.action%></td>
|
||||
<td><%= audit.action_at.strftime("%m-%d-%Y %H:%M %p")%></td>
|
||||
<td><%= audit.approved_by%></td>
|
||||
<td><%= audit.remark%></td>
|
||||
<td><%= audit.remark%></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
@@ -297,7 +297,7 @@
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<button class='btn btn-md waves-effect payment-btn-box payment_btn bg-green' data-type='Credit' data-value='Credit'>Credit</button>
|
||||
</div>
|
||||
|
||||
|
||||
<% @payment_methods.each_with_index do |pay, pay_index| %>
|
||||
<%if (pay_index+1)%3 == 0 %>
|
||||
<div class="row clearfix"></div>
|
||||
@@ -308,8 +308,8 @@
|
||||
<%end %>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- </select> -->
|
||||
|
||||
<!-- </select> -->
|
||||
</div>
|
||||
<div class="modal-footer p-r-30 pb-3">
|
||||
<button type="button" class="btn btn-md btn-link btn-danger waves-effect" data-dismiss="modal">CLOSE</button>
|
||||
@@ -367,17 +367,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
// click select option icon for add
|
||||
$('.payment_btn').on('click', function(event){
|
||||
// click select option icon for add
|
||||
$('.payment_btn').on('click', function(event){
|
||||
active = $(this).hasClass('selected-payment');
|
||||
value = $(this).data('value');
|
||||
type = $(this).data('type');
|
||||
group = $(this).data('group');
|
||||
payments = $(".payment_btn");
|
||||
|
||||
if (active) {
|
||||
if (active) {
|
||||
$(this).removeClass('selected-payment');
|
||||
}else{
|
||||
}else{
|
||||
$(this).addClass('selected-payment');
|
||||
}
|
||||
}); //End selecct attribute buttom
|
||||
@@ -415,7 +415,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}else{
|
||||
swal("Opps","You are not authorized for void","warning")
|
||||
}
|
||||
@@ -438,14 +438,14 @@
|
||||
if(!location.pathname.includes("credit_payment")){
|
||||
calculate_member_discount(sale_id,"Cash",tax_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$( "#loading_wrapper" ).hide();
|
||||
receipt_no = "<%= @sale.receipt_no %>";
|
||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||
createReceiptNoInFirstBillData(receipt_no,type);
|
||||
|
||||
|
||||
window.location = '/origami/sale/'+sale_id+'/transaction/payment';
|
||||
});
|
||||
|
||||
@@ -454,4 +454,3 @@
|
||||
window.location = '/origami/sale/'+sale_id+'/transaction/payment';
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user