add total grand balance
This commit is contained in:
@@ -122,6 +122,7 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
#get customer amount
|
#get customer amount
|
||||||
@customer = Customer.find(params[:id])
|
@customer = Customer.find(params[:id])
|
||||||
@response = Customer.get_membership_transactions(@customer)
|
@response = Customer.get_membership_transactions(@customer)
|
||||||
|
puts @response.to_json
|
||||||
|
|
||||||
Rails.logger.debug "get membership transactions response"
|
Rails.logger.debug "get membership transactions response"
|
||||||
Rails.logger.debug @response.to_json
|
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.sales_status") %></th>
|
||||||
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
<th><%= t("views.right_panel.detail.receipt_date") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<% add_grand_total =0 %>
|
||||||
<% @sales.each do |sale| %>
|
<% @sales.each do |sale| %>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
||||||
<td><%= sale.receipt_no %></td>
|
<td><%= sale.receipt_no %></td>
|
||||||
<td><%= sale.total_discount %></td>
|
<td><%= sale.total_discount %></td>
|
||||||
@@ -194,7 +197,15 @@
|
|||||||
<td> <%= sale.sale_status %> </td>
|
<td> <%= sale.sale_status %> </td>
|
||||||
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
<td> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<% add_grand_total += sale.grand_total%>
|
||||||
<% end %>
|
<% 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>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user