diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 773892f3..2d03d298 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -7,7 +7,7 @@ class Origami::HomeController < BaseOrigamiController @tables = Table.unscoped.all.active.order('status desc') @rooms = Room.unscoped.all.active.order('status desc') @complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d')) - @orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc') + @orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc') @shop = Shop.first # @shift = ShiftSale.current_open_shift(current_user.id) diff --git a/app/controllers/origami/rooms_controller.rb b/app/controllers/origami/rooms_controller.rb index 6877f8aa..49b7ce14 100755 --- a/app/controllers/origami/rooms_controller.rb +++ b/app/controllers/origami/rooms_controller.rb @@ -3,7 +3,7 @@ class Origami::RoomsController < BaseOrigamiController @tables = Table.unscoped.all.active.order('status desc') @rooms = Room.unscoped.all.active.order('status desc') @complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d')) - @orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc') + @orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc') # @shift = ShiftSale.current_open_shift(current_user.id) @webview = false if check_mobile @@ -20,7 +20,7 @@ class Origami::RoomsController < BaseOrigamiController @tables = Table.unscoped.all.active.order('status desc') @rooms = Room.unscoped.all.active.order('status desc') @complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d')) - @orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc') + @orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc') @room = DiningFacility.find(params[:room_id]) diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index 3f9daa9a..3e565ffa 100755 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -50,8 +50,8 @@