Files
sx-fc/app/controllers/origami/customers_controller.rb
2017-06-11 18:00:34 +06:30

39 lines
873 B
Ruby

class Origami::CustomersController < BaseOrigamiController
#Form to add customer -
def index
end
# GET /crm/customers/1
# GET /crm/customers/1.json
def show
end
def add_customer
@sale_id = params[:sale_id]
filter = params[:filter]
if filter.nil?
@crm_customers = Customer.order("name").page(params[:page])
else
@crm_customers = Customer.where("name LIKE ?", "%#{filter}%").order("name").page(params[:page])
end
@crm_customer = Customer.new
@membership = Customer.get_member_group
if @membership["status"] == true
@member_group = @membership["data"]
end
respond_to do |format|
# format.html { render :template => "crm/customers/index" }
format.html { render action: "index"}
format.json { render json: @crm_customers }
end
end
end