update membership in sale detail

This commit is contained in:
Aung Myo
2017-06-15 17:13:11 +06:30
parent f0d3f30d88
commit 4098c99509
3 changed files with 81 additions and 11 deletions

View File

@@ -50,6 +50,18 @@ class Transactions::SalesController < ApplicationController
end
@sale_receivables = SalePayment.where('sale_id = ?', @sale.id)
#get customer amount
@customer = Customer.find(@sale.customer_id)
response = Customer.get_member_account(@customer)
if(response["status"] == true)
@membership = response["data"]
else
@membership = 0
end
#end customer amount
respond_to do |format|
format.html # show.html.erb
format.json { render json: @sale }