crm update

This commit is contained in:
Aung Myo
2017-06-11 18:00:34 +06:30
parent 9c228dce5c
commit d65882ac5b
10 changed files with 146 additions and 75 deletions

View File

@@ -1,7 +1,38 @@
class Origami::CustomersController < BaseOrigamiController
#Form to add customer -
def index
end
def create
# 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