update payment report

This commit is contained in:
Aung Myo
2017-11-30 17:24:15 +06:30
parent 5b9182c1d1
commit 3ddd4121db
4 changed files with 15 additions and 8 deletions

View File

@@ -82,7 +82,7 @@
<tr>
<th> <%= t("views.right_panel.detail.shift_name") %> </th>
<th> <%= t("views.right_panel.detail.payment_method") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t :payment_method %></th>
<th> <%= t("views.right_panel.detail.amount") %> </th>
@@ -92,7 +92,11 @@
<tbody>
<% total = 0 %>
<% @pyament_method.each do |payment| %>
<% total += payment.payment_amount + payment.outstanding_amount %>
<% if payment.payment_method === 'cash'
total += payment.payment_amount - payment.change_amount
else
total += payment.payment_amount
end%>
<tr>
<% if @shift_from.nil? && @shift_to.nil? %>
<td><%= payment.sale_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-'%></td>
@@ -103,7 +107,11 @@
<td><%= payment.cashier_name rescue '-' %></td>
<!--<td><%= payment.sale.customer.name rescue '-' %></td>-->
<td><%= payment.payment_method rescue '-' %></td>
<td><%= payment.payment_amount + payment.outstanding_amount%> </td>
<% if payment.payment_method === 'cash' %>
<td><%= payment.payment_amount - payment.change_amount%> </td>
<%else%>
<td><%= payment.payment_amount%> </td>
<%end%>
<td><%= payment.sale.grand_total rescue '-' %></td>
</tr>