update crm and bill

This commit is contained in:
Aung Myo
2017-07-02 14:06:21 +06:30
parent 09370a2a78
commit a0e16bd485
4 changed files with 87 additions and 34 deletions

View File

@@ -48,7 +48,22 @@ class Crm::CustomersController < BaseCrmController
#get customer amount
@customer = Customer.find(params[:id])
@response = Customer.get_membership_transactions(@customer)
@response = Customer.get_membership_transactions(@customer)
# get member information
total = Customer.get_member_account(@customer)
@balance = 0.00
@accountable_type = ''
if total["status"]==true
total["data"].each do |res|
if res["accountable_type"] == "RebateAccount" || res["accountable_type"] == "RebatebonusAccount"
@balance += res["balance"]
# @accountable_type = res["accountable_type"]
@accountable_type = "Rebate Balance"
end
end
end
# @response = ""
#end customer amount