show and update changes in commission and report

This commit is contained in:
Zin Lin Phyo
2017-09-04 10:24:24 +06:30
parent 09ba513c1c
commit 98dae6d712
7 changed files with 306 additions and 237 deletions

View File

@@ -77,7 +77,7 @@
<%= sale_item.qty %>
</td>
<td class='unit_price' width="20%">
<%= sale_item.unit_price %>
<%= sale_item.price %>
</td>
<td class='commissioner' width="20%">
<% product_commission = ProductCommission.find_by_sale_item_id(sale_item.id) %>

View File

@@ -29,6 +29,8 @@
<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>Sale</th>
<th>Sale Item</th>
<th>Commissioner Name</th>
<th>Product Name</th>
<th>Qty</th>
@@ -44,12 +46,10 @@
<% @transaction.each do |result| %>
<tr>
<td>
<%= result.commissioner.name rescue '-' %>
</td>
<td>
<%= result.commission.menu_item.name rescue '-' %>
</td>
<td><%= result.sale_id rescue '-' %></td>
<td><%= result.sale_item_id rescue '-' %></td>
<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>
@@ -61,7 +61,7 @@
<% end %>
<tr style="border-top: 3px solid grey;">
<td colspan="2"></td>
<td colspan="4"></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>

View File

@@ -8,7 +8,7 @@
<%= f.input :commission_type, :collection => ['Percentage','Net Amount'], prompt: 'Select Commission Type', class: 'form-control' %>
<%= f.input :amount %>
<label><%= f.check_box :is_active %> Active </label>
</div><br>
<div class="form-actions">
<%= link_to 'Back', settings_commissions_path, class: 'btn btn-success' %>