change commission report xls format

This commit is contained in:
phyusin
2018-06-27 11:22:25 +06:30
parent d763f9212a
commit a6d4f393fc

View File

@@ -14,12 +14,14 @@
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %></th> <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>
<tr> <tr>
<th>Commissioner Name</th> <th><%= t :sale %></th>
<th>Product Name</th> <th><%= t :sale %> <%= t("views.right_panel.detail.item") %></th>
<th>Qty</th> <th><%= t :commissioner %> <%= t("views.right_panel.detail.name") %></th>
<th>Commission Price</th> <th><%= t("views.right_panel.detail.product") %> <%= t("views.right_panel.detail.name") %></th>
<th>Commission Amount</th> <th><%= t("views.right_panel.detail.qty") %></th>
<th>Date</th> <th><%= t("views.right_panel.detail.commission_price") %></th>
<th><%= t("views.right_panel.detail.commission_amount") %></th>
<th><%= t("views.right_panel.detail.date") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -29,12 +31,10 @@
<% @transaction.each do |result| %> <% @transaction.each do |result| %>
<tr> <tr>
<td> <td><%= result.sale_id rescue '-' %></td>
<%= result.commissioner.name rescue '-' %> <td><%= result.sale_item_id rescue '-' %></td>
</td> <td><%= result.commissioner.name rescue '-' %></td>
<td> <td><%= result.porduct_name rescue '-' %></td>
<%= result.commission.menu_item.name rescue '-' %>
</td>
<td><%= sprintf "%.2f", result.qty.to_f.to_d 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.price.to_f.to_d rescue '-' %></td>
<td><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %></td> <td><%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %></td>