From 850c134ed2c9dfd7f77fe59747c5b53408269d69 Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 29 Mar 2018 11:17:35 +0630 Subject: [PATCH] check product sale --- app/models/ability.rb | 5 +++++ app/models/sale.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 0b1edcc3..b1930e1b 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -179,6 +179,11 @@ class Ability can :remove_all_discount, :discount can :member_discount, :discount + can :move_dining, :movetable + can :moving, :movetable + + can :move_dining, :moveroom + can :manage, Customer can :manage, DiningQueue diff --git a/app/models/sale.rb b/app/models/sale.rb index 970896bf..ebb32ec3 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -950,7 +950,7 @@ def self.get_menu_item_query(order_by) " LEFT JOIN sale_items si ON si.item_instance_code = mii.item_instance_code" + " LEFT JOIN sales s ON s.sale_id = si.sale_id") .where("(CASE WHEN s.sale_status IS NOT NULL THEN s.sale_status='completed' ELSE 1 END)") - .group("mc.id, (CASE WHEN si.product_name IS NOT NULL THEN si.product_name ELSE mii.item_instance_name END)") + .group("mc.id, (CASE WHEN si.product_name IS NOT NULL THEN si.product_name ELSE CONCAT(menu_items.name,' - ',mii.item_instance_name) END)") .order("si.qty #{order_by}, menu_items.menu_category_id #{order_by}") end #product sale report query