customer update
This commit is contained in:
@@ -8,7 +8,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
filter = params[:filter]
|
||||
filter_card_no = params[:filter_card_no]
|
||||
type = params[:type]
|
||||
@customer_update_phone_email =false
|
||||
@customer_update_phone_email_membertype =false
|
||||
if filter_card_no==""
|
||||
@crm_customers = Customer.all
|
||||
elsif !filter_card_no.nil?
|
||||
@@ -46,13 +46,16 @@ class Crm::CustomersController < BaseCrmController
|
||||
else
|
||||
@crm_customers.each do |customer|
|
||||
if customer.contact_no != response["customer_data"]["phone"]
|
||||
@customer_update_phone_email =true
|
||||
@customer_update_phone_email_membertype =true
|
||||
end
|
||||
if customer.email != response["customer_data"]["email"]
|
||||
@customer_update_phone_email =true
|
||||
@customer_update_phone_email_membertype =true
|
||||
end
|
||||
if customer.name != response["customer_data"]["name"]
|
||||
@customer_update_phone_email =true
|
||||
@customer_update_phone_email_membertype =true
|
||||
end
|
||||
if customer.membership_type.to_i != response["customer_data"]["member_group_id"]
|
||||
@customer_update_phone_email_membertype =true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -554,13 +557,14 @@ class Crm::CustomersController < BaseCrmController
|
||||
end
|
||||
end
|
||||
|
||||
def customer_update_phone_email
|
||||
def customer_update_phone_email_member_type
|
||||
@customer = Customer.find(params[:id])
|
||||
response = Customer.search_paypar_account_no(@customer.paypar_account_no)
|
||||
if response["status"] == true
|
||||
@customer.name =response["customer_data"]["name"]
|
||||
@customer.contact_no =response["customer_data"]["phone"]
|
||||
@customer.email =response["customer_data"]["email"]
|
||||
@customer.membership_type =response["customer_data"]["member_group_id"]
|
||||
@customer.save
|
||||
respond_to do |format|
|
||||
format.html { redirect_to crm_customers_path }
|
||||
|
||||
Reference in New Issue
Block a user