diff --git a/app/models/order.rb b/app/models/order.rb index 3fabf91b..2ea073be 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -254,7 +254,7 @@ class Order < ApplicationRecord left join dining_facilities on dining_facilities.id = bookings.dining_facility_id left join order_items on order_items.order_id = orders.order_id") .where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,"dine_in",true) - .group("orders.order_id,order_items.id,dining_facilities.name") + .group("orders.order_id,order_items.order_item_id,dining_facilities.name") end #Origami: Cashier : to view orders @@ -270,9 +270,7 @@ class Order < ApplicationRecord left join sale_orders on sale_orders.order_id = orders.order_id left join sales on sales.sale_id = sale_orders.sale_id") .where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to) - - .group("orders.id,order_items.id,dining_facilities.name") - + .group("orders.order_id,order_items.order_item_id,dining_facilities.name") end