diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index c895c4b6..50c0da09 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -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 diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 572b3937..646cd06a 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -179,11 +179,14 @@ <%= t("views.right_panel.detail.sales_status") %> <%= t("views.right_panel.detail.receipt_date") %> + + <% add_grand_total =0 %> <% @sales.each do |sale| %> + <%= link_to sale.sale_id, transactions_sale_path(sale) %> <%= sale.receipt_no %> <%= sale.total_discount %> @@ -194,7 +197,15 @@ <%= sale.sale_status %> <%= sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> + <% add_grand_total += sale.grand_total%> <% end %> + <% if !@sales.empty?%> + + Balance + <%= add_grand_total %> + + <% end %> +