current shop
This commit is contained in:
@@ -38,7 +38,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
@crm_customers.membership_type = response["customer_data"]["member_group_id"]
|
||||
@crm_customers.customer_type = "Dinein"
|
||||
@crm_customers.tax_profiles = ["1", "2"]
|
||||
@crm_customers.shop_code = @shop.shop_code
|
||||
@crm_customers.shop_code = Shop.current_shop.shop_code
|
||||
@crm_customers.save
|
||||
@crm_customers = Customer.search(filter)
|
||||
flash[:member_notice]='Customer was successfully created.'
|
||||
@@ -130,7 +130,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
|
||||
params[:type] = nil
|
||||
params[:customer_id] = params[:id]
|
||||
@credit_sales = SalePayment.get_credit_sales(params,@shop.shop_code)
|
||||
@credit_sales = SalePayment.get_credit_sales(params,Shop.current_shop.shop_code)
|
||||
|
||||
#get customer amount
|
||||
@customer = Customer.find(params[:id])
|
||||
@@ -255,7 +255,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
if @checked_contact.nil?
|
||||
respond_to do |format|
|
||||
@crm_customers = Customer.new(customer_params)
|
||||
@crm_customers.shop_code = @shop.shop_code
|
||||
@crm_customers.shop_code = Shop.current_shop.shop_code
|
||||
if @crm_customers.save
|
||||
# update tax profile
|
||||
customer = Customer.find(@crm_customers.customer_id)
|
||||
|
||||
@@ -6,8 +6,8 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
# GET /crm/dining_queues.json
|
||||
def index
|
||||
today = DateTime.now.strftime('%Y-%m-%d')
|
||||
@dining_queues = DiningQueue.where("shop_code='#{@shop.shop_code}' and DATE_FORMAT(created_at,'%Y-%m-%d') = ? and status is NULL ", today).order("queue_no asc")
|
||||
@complete_queue = DiningQueue.where("shop_code='#{@shop.shop_code}' and DATE_FORMAT(created_at,'%Y-%m-%d') = ? and status = 'Assign' ", today).order("queue_no asc")
|
||||
@dining_queues = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and status is NULL ", today).order("queue_no asc")
|
||||
@complete_queue = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and status = 'Assign' ", today).order("queue_no asc")
|
||||
|
||||
if params[:term]
|
||||
@customer = Customer.order(:name).where('lower(name) LIKE ?', "%#{params[:term].downcase}%")
|
||||
@@ -40,7 +40,7 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
# POST /crm/dining_queues.json
|
||||
def create
|
||||
@dining_queue = DiningQueue.new(dining_queue_params)
|
||||
@dining_queue.shop_code = @shop.shop_code
|
||||
@dining_queue.shop_code = Shop.current_shop.shop_code
|
||||
respond_to do |format|
|
||||
if @dining_queue.save
|
||||
|
||||
@@ -87,7 +87,7 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
|
||||
def assign
|
||||
@queue = DiningQueue.find(params[:id])
|
||||
@tables = DiningFacility.where("status = 'available' and shop_code='#{@shop.shop_code}' and type!='HotelRoom'")
|
||||
@tables = DiningFacility.where("status = 'available' and type!='HotelRoom'")
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
end
|
||||
@@ -108,8 +108,7 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
:type => type,
|
||||
:checkin_at => Time.now.utc,
|
||||
:customer_id => queue.customer_id,
|
||||
:booking_status => "assign",
|
||||
:shop_code => @shop.shop_code})
|
||||
:booking_status => "assign"})
|
||||
booking.save!
|
||||
|
||||
status = queue.update_attributes(dining_facility_id: table_id,status:"Assign")
|
||||
@@ -138,7 +137,7 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_dining_queue
|
||||
@dining_queue = DiningQueue.find_by_id_and_shop_code(params[:id],@shop.shop_code)
|
||||
@dining_queue = DiningQueue.find_by_id(params[:id])
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
|
||||
Reference in New Issue
Block a user