201 lines
12 KiB
Plaintext
Executable File
201 lines
12 KiB
Plaintext
Executable File
|
|
<div class="page-header" style="width:130%;">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
|
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
|
|
<span class="float-right">
|
|
<%= link_to 'Back', dashboard_path %>
|
|
</span>
|
|
</ol>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12 col-lg-12 col-sm-12 ">
|
|
<%= render :partial=>'shift_sale_report_filter',
|
|
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
|
|
<hr />
|
|
<div class=" text-right">
|
|
<a href="javascript:export_to('<%=reports_dailysale_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12 col-lg-12">
|
|
<div class="card" style="width:129%;">
|
|
<div class="body table-responsive">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="15"> <%= 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>
|
|
<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>
|
|
<th style='text-align:center;'><%= t("views.right_panel.detail.mpu_sales") %></th>
|
|
<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>
|
|
<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.rnd_adj_sh") %></th>
|
|
|
|
</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.empty? %>
|
|
|
|
<tbody>
|
|
<% void = 0 %>
|
|
<% mpu = 0 %>
|
|
<% master = 0 %>
|
|
<% visa = 0 %>
|
|
<% jcb = 0 %>
|
|
<% unionpay = 0 %>
|
|
<% alipay = 0 %>
|
|
<% paymal = 0 %>
|
|
<% dinga = 0 %>
|
|
<% junctionpay = 0 %>
|
|
<% paypar = 0 %>
|
|
<% cash = 0 %>
|
|
<% credit = 0 %>
|
|
<% foc = 0 %>
|
|
<% discount = 0 %>
|
|
<% total = 0 %>
|
|
<% grand_total = 0 %>
|
|
<% old_grand_total = 0 %>
|
|
<% count = 1 %> <% rounding_adj = 0 %>
|
|
<% @sale_data.each do |sale| %>
|
|
<% void += sale[:void_amount] %>
|
|
<% mpu += sale[:mpu_amount] %>
|
|
<% 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] %>
|
|
<% foc += sale[:foc_amount] %>
|
|
<% discount += sale[:total_discount] %>
|
|
<% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %>
|
|
<% grand_total += sale[:grand_total].to_f %>
|
|
<% old_grand_total += sale[:old_grand_total].to_f %>
|
|
<% rounding_adj += sale[:rounding_adj].to_f %>
|
|
<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>
|
|
<td style='text-align:right;'><%= number_with_precision(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
|
<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>
|
|
<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>
|
|
|
|
</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(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>
|
|
<td style='text-align:right;'><%= number_with_precision(foc, precision:precision,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>
|
|
|
|
</tr>
|
|
<% total_tax = 0
|
|
tax_amount = 0
|
|
tax_name = ''
|
|
tax_arr = [] %>
|
|
<% net = 0 %>
|
|
<% unless @tax.empty? %>
|
|
<% @tax.each do |tax| %>
|
|
<% if tax.tax_name.downcase == tax_name.downcase
|
|
tax_amount += tax.tax_amount
|
|
else
|
|
tax_amount = tax.tax_amount
|
|
end
|
|
tax_name = tax.tax_name
|
|
total_tax += tax.tax_amount.to_f
|
|
%>
|
|
<tr style="font-weight:600;">
|
|
<td colspan="17" style='text-align:right;'><%= tax_name rescue '-'%></td>
|
|
<td style='text-align:right;'><%= number_with_precision(tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<tr style="font-weight:600;">
|
|
<td colspan="17" style='text-align:right;'>Discount </td>
|
|
<td style='text-align:right;'><%= number_with_precision(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
|
|
<% net = grand_total %>
|
|
<% net = grand_total + discount%>
|
|
<% 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 style='text-align:right;'><%= number_with_precision(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
</tbody>
|
|
<% end %>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div> |