add total grand balance

This commit is contained in:
Myat Zin Wai Maw
2019-05-28 14:02:14 +06:30
parent ffe279b2ee
commit b40d4982f3
2 changed files with 12 additions and 0 deletions

View File

@@ -122,6 +122,7 @@ class Crm::CustomersController < BaseCrmController
#get customer amount
@customer = Customer.find(params[:id])
@response = Customer.get_membership_transactions(@customer)
puts @response.to_json
Rails.logger.debug "get membership transactions response"
Rails.logger.debug @response.to_json

View File

@@ -179,11 +179,14 @@
<th><%= t("views.right_panel.detail.sales_status") %></th>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
</tr>
</thead>
<tbody>
<% add_grand_total =0 %>
<% @sales.each do |sale| %>
<tr>
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
<td><%= sale.receipt_no %></td>
<td><%= sale.total_discount %></td>
@@ -194,7 +197,15 @@
<td> <%= sale.sale_status %> </td>
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
<% add_grand_total += sale.grand_total%>
<% end %>
<% if !@sales.empty?%>
<tr style="border-top:2px solid #666;">
<th colspan="5">Balance</th>
<th colspan="4"><%= add_grand_total %></th>
</tr>
<% end %>
</tbody>
</table>
</div>