update payment menthod report
This commit is contained in:
98
app/views/reports/payment_method/index.xls.erb
Executable file
98
app/views/reports/payment_method/index.xls.erb
Executable file
@@ -0,0 +1,98 @@
|
||||
<div class="container margin-top-20">
|
||||
<div class="card row">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th>Recipt No</th>
|
||||
<th>Cashier Name</th>
|
||||
<th>Total Amount</th>
|
||||
<th>Discount Amount </th>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<th><%= tax.tax_name %></th>
|
||||
|
||||
<% end %>
|
||||
<!-- <th>Other Amount</th> -->
|
||||
<th>Grand Total</th>
|
||||
<th>Rounding Adj.</th>
|
||||
<th>Grand Total +<br/>
|
||||
Rounding Adj.
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% total_tax = 0 %>
|
||||
<% guest_count = 0 %>
|
||||
<% total_sum = 0 %>
|
||||
<% discount_amt = 0 %>
|
||||
<% other_amt = 0 %>
|
||||
<% total_nett = 0 %>
|
||||
<% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %>
|
||||
<%if @sale_data %>
|
||||
<% @sale_data.each do |result| %>
|
||||
|
||||
<% grand_total = grand_total.to_f + result.grand_total.to_f %>
|
||||
<% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %>
|
||||
<% total_tax += result.total_tax.to_f %>
|
||||
<% total_sum += result.total_amount.to_f %>
|
||||
<% discount_amt += result.total_discount.to_f %>
|
||||
<% rounding_adj += result.rounding_adjustment.to_f %>
|
||||
|
||||
<tr>
|
||||
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.total_amount rescue '-' %></td>
|
||||
<td><%= result.total_discount rescue '-' %></td>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_payable_amount rescue '-' %></td>
|
||||
<%end%>
|
||||
|
||||
<td><%= result.old_grand_total %></td>
|
||||
<td><%= result.rounding_adjustment.to_f rescue '-' %></td>
|
||||
<td><%= result.grand_total_after_rounding() rescue '-'%></td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;">
|
||||
<td colspan="2"> </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><%= old_grand_total.to_f.round(2) rescue '-'%></b></td>
|
||||
<td><b><%= rounding_adj rescue '-'%></b></td>
|
||||
<td><b><%= old_grand_total.to_f.round + rounding_adj %></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
<td>Total Amount</td>
|
||||
<td>Discount Amount</td>
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_name %></td>
|
||||
<% end %>
|
||||
<td>Grand Total</td>
|
||||
<td>Rounding Adj.</td>
|
||||
<td>Grand Total +<br/>
|
||||
Rounding Adj.
|
||||
</td>
|
||||
</tr>
|
||||
<%end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user