fixed conflict file

This commit is contained in:
Aung Myo
2017-06-13 10:40:49 +06:30
19 changed files with 196 additions and 120 deletions

View File

@@ -5,7 +5,7 @@ class Crm::CustomersController < BaseCrmController
# GET /crm/customers.json
def index
filter = params[:filter]
if filter.nil?
@crm_customers = Customer.order("customer_id").page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5)
@@ -31,7 +31,7 @@ class Crm::CustomersController < BaseCrmController
# GET /crm/customers/1.json
def show
@orders = Order.where("customer_id=?", params[:id])
if @orders
@order_items = []
@orders.each do |bo|
@@ -57,7 +57,6 @@ class Crm::CustomersController < BaseCrmController
def create
@crm_customers = Customer.new(customer_params)
respond_to do |format|
puts @crm_customers.errors.to_json
if @crm_customers.save
@@ -73,7 +72,9 @@ class Crm::CustomersController < BaseCrmController
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
dob: dob,
member_group_id: member_group_id,merchant_uid:merchant_uid}.to_json,
:headers => {
'Content-Type' => 'application/json',
@@ -82,18 +83,18 @@ class Crm::CustomersController < BaseCrmController
)
if response["status"] == true
customer = Customer.find(@crm_customers.customer_id)
status = customer.update_attributes(membership_id: response["customer_datas"]["id"])
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer', notice: 'Customer was successfully created.' }
else
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created'}
end
end
# format.json { render :index, status: :created, location: @crm_customers }
else
@crm_customers.destroy
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer'}
@@ -104,7 +105,7 @@ class Crm::CustomersController < BaseCrmController
else
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer'}
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer'}
else
format.html { redirect_to crm_customers_path}
@@ -133,7 +134,7 @@ end
memberaction = MembershipAction.find_by_membership_type("update_membership_customer")
merchant_uid = memberaction.merchant_account_id.to_s
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
dob: dob,
id: id,member_group_id:member_group_id,merchant_uid:merchant_uid}.to_json,