diff --git a/app/controllers/api/orders_controller.rb b/app/controllers/api/orders_controller.rb index 49a5c524..b06a7a6f 100755 --- a/app/controllers/api/orders_controller.rb +++ b/app/controllers/api/orders_controller.rb @@ -118,7 +118,7 @@ class Api::OrdersController < Api::ApiController @order = Order.new @order.source = params[:order_source] @order.order_type = params[:order_type] - @order.customer_id = params[:customer_id].present? ? params[:customer_id] : walkin.customer_id # for no customer id from mobile + @order.customer_id = params[:customer_id].present? ? params[:customer_id] : Customer.walkin.customer_id # for no customer id from mobile @order.items = items_arr @order.guest = params[:guest_info] @order.table_id = params[:table_id] # this is dining facilities's id diff --git a/app/controllers/concerns/multi_tenancy.rb b/app/controllers/concerns/multi_tenancy.rb index a88cc9e0..630282d7 100644 --- a/app/controllers/concerns/multi_tenancy.rb +++ b/app/controllers/concerns/multi_tenancy.rb @@ -12,7 +12,7 @@ module MultiTenancy if request.subdomains.last && request.subdomains.last != 'www' set_current_tenant(Shop.find_by(subdomain: request.subdomains.last)) end - set_current_tenant(Shop.first) if current_tenant.nil? + set_current_tenant(Shop.last) if current_tenant.nil? end def current_shop diff --git a/app/controllers/foodcourt/addorders_controller.rb b/app/controllers/foodcourt/addorders_controller.rb index 7392f012..b57707eb 100755 --- a/app/controllers/foodcourt/addorders_controller.rb +++ b/app/controllers/foodcourt/addorders_controller.rb @@ -122,7 +122,7 @@ class Foodcourt::AddordersController < BaseFoodcourtController if params[:order_source] == "quick_service" && params[:table_id].to_i == 0 customer_id = takeaway.customer_id # for no customer id from mobile else - customer_id = params[:customer_id].present? ? params[:customer_id] : walkin.customer_id # for no customer id from mobile + customer_id = params[:customer_id].present? ? params[:customer_id] : Customer.walkin.customer_id # for no customer id from mobile end @order = Order.new diff --git a/app/controllers/foodcourt/payments_controller.rb b/app/controllers/foodcourt/payments_controller.rb index 6e7e2859..ae16871d 100755 --- a/app/controllers/foodcourt/payments_controller.rb +++ b/app/controllers/foodcourt/payments_controller.rb @@ -241,8 +241,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController # @shop = shop_detail #show shop info - @customer_lists = Customer.where("customer_id = 'CUS-000000000001' or customer_id = 'CUS-000000000002'") - + @customer_lists = Customer.where(name: ["WALK-IN", "TAKEAWAY"]) saleObj = Sale.find(sale_id) #total customer with individual total amount diff --git a/app/models/printer/printer_worker.rb b/app/models/printer/printer_worker.rb index 5d7cce22..d30af42d 100755 --- a/app/models/printer/printer_worker.rb +++ b/app/models/printer/printer_worker.rb @@ -42,17 +42,17 @@ class Printer::PrinterWorker end def print(file_path, printer_destination = nil ) - # if printer_destination.nil? - # printer_destination = self.printer_destination - # end + if printer_destination.nil? + printer_destination = self.printer_destination + end - # copy = self.print_copies - # #Print only when printer information is not null - # if !self.printer_destination.nil? - # (1..copy).each do - # page = Cups::PrintJob.new(file_path, printer_destination) - # page.print - # end - # end + copy = self.print_copies + #Print only when printer information is not null + if !self.printer_destination.nil? + (1..copy).each do + page = Cups::PrintJob.new(file_path, printer_destination) + page.print + end + end end end diff --git a/app/views/foodcourt/addorders/detail.html.erb b/app/views/foodcourt/addorders/detail.html.erb index d9fe48e1..2a337c28 100644 --- a/app/views/foodcourt/addorders/detail.html.erb +++ b/app/views/foodcourt/addorders/detail.html.erb @@ -190,7 +190,6 @@