From e66dd33c1a21b9cd68ef89095a51762513426bcd Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 6 Jun 2017 10:27:59 +0630 Subject: [PATCH] updated order.rb --- app/models/order.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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