82 lines
2.5 KiB
Plaintext
82 lines
2.5 KiB
Plaintext
<div class="page-header">
|
|
<ul class="breadcrumb">
|
|
<li><a href="<%= dashboard_path %>">Home</a></li>
|
|
<li>Commission Report</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<%= render :partial => 'commission_report_filter',
|
|
:locals => {:period_type => true, :shift_name => true, :report_path => reports_commission_index_path} %>
|
|
<hr/>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-12 text-right">
|
|
<a href="javascript:export_to('<%= reports_commission_index_path %>.xls')" class="btn btn-default">Export to
|
|
Excel</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container margin-top-20">
|
|
<div class="card row">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped">
|
|
<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>
|
|
<tr>
|
|
<th>Commissioner Name</th>
|
|
<th>Product Name</th>
|
|
<th>Qty</th>
|
|
<th>Commission Price</th>
|
|
<th>Commission Amount</th>
|
|
<th>Date</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% total_qty = 0 %>
|
|
<% total_price = 0 %>
|
|
<% total_amount = 0 %>
|
|
|
|
<% @transaction.each do |result| %>
|
|
<tr>
|
|
<td>
|
|
<%= result.commissioner.name rescue '-' %>
|
|
</td>
|
|
<td>
|
|
<%= result.commission.menu_item.name rescue '-' %>
|
|
</td>
|
|
<td><%= sprintf "%.2f", result.qty.to_f.to_d rescue '-' %></td>
|
|
<td><%= sprintf "%.2f", result.price.to_f.to_d rescue '-' %></td>
|
|
<td><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %></td>
|
|
<td><%= result.updated_at.strftime("%e %b %Y %I:%M%p") rescue '-' %></td>
|
|
</tr>
|
|
<% total_qty += result.qty.to_f %>
|
|
<% total_price += result.price.to_f %>
|
|
<% total_amount += result.amount.to_f %>
|
|
<% end %>
|
|
|
|
<tr style="border-top: 3px solid grey;">
|
|
<td colspan="2"></td>
|
|
<td><b><%= sprintf("%.2f", total_qty) rescue '-' %></b></td>
|
|
<td><b><%= sprintf("%.2f", total_price) rescue '-' %></b></td>
|
|
<td><b><%= sprintf("%.2f", total_amount) rescue '-' %></b></td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$(function () {
|
|
|
|
});
|
|
</script>
|
|
|
|
|