update lookup

This commit is contained in:
Aung Myo
2017-07-31 17:33:06 +06:30
parent bc5a7d01f7
commit b3c77fc28c
6 changed files with 32 additions and 22 deletions

View File

@@ -96,7 +96,8 @@ class Crm::CustomersController < BaseCrmController
merchant_uid:merchant_uid,auth_token:auth_token}.to_json
# Check for paypar account exists
if paypar_account_no != nil || paypar_account_no != ''
# if paypar_account_no != nil || paypar_account_no != ''
if paypar_account_no.present?
member_params = { name: name,phone: phone,email: email,
dob: dob,address: address,nrc:nrc,card_no:card_no,
paypar_account_no: paypar_account_no,
@@ -150,7 +151,12 @@ class Crm::CustomersController < BaseCrmController
# When paypar account no not exist in paypar
if response["message"] == "Account has not exist."
customer.destroy
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer cannot created.' + response["message"]}
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer cannot created.' + response["message"]}
else
format.html { redirect_to crm_customers_path, notice: 'Customer cannot created.' + response["message"] }
end
end
if params[:sale_id]