add total grand balance
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user