update customer amount
This commit is contained in:
@@ -10,13 +10,13 @@ class Crm::CustomersController < BaseCrmController
|
||||
@crm_customers = Customer.order("customer_id").page(params[:page])
|
||||
#@products = Product.order("name").page(params[:page]).per(5)
|
||||
else
|
||||
@crm_customers = Customer.where("name LIKE ?", "%#{filter}%").order("name").page(params[:page])
|
||||
end
|
||||
@crm_customers = Customer.where("name LIKE ?", "%#{filter}%").order("name").page(params[:page]) end
|
||||
#@crm_customers = Customer.all
|
||||
@crm_customer = Customer.new
|
||||
if @crm_customer.valid?
|
||||
@crm_customer.errors.messages
|
||||
end
|
||||
|
||||
|
||||
# puts @crm_customer.valid?
|
||||
|
||||
# @membership = Customer.get_member_group
|
||||
# if @membership["status"] == true
|
||||
# @member_group = @membership["data"]
|
||||
@@ -57,8 +57,9 @@ 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
|
||||
name = customer_params[:name]
|
||||
phone = customer_params[:contact_no]
|
||||
@@ -105,6 +106,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
if params[:sale_id]
|
||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer'}
|
||||
else
|
||||
|
||||
format.html { redirect_to crm_customers_path}
|
||||
format.json { render json: @crm_customers.errors, status: :unprocessable_entity }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user