diff --git a/app/controllers/origami/dashboard_controller.rb b/app/controllers/origami/dashboard_controller.rb index ac9ece74..ceddc3b0 100644 --- a/app/controllers/origami/dashboard_controller.rb +++ b/app/controllers/origami/dashboard_controller.rb @@ -3,7 +3,7 @@ class Origami::DashboardController < BaseOrigamiController def index today = DateTime.now.strftime('%Y-%m-%d') - @display_type = Lookup.where("shop_code='#{@shop.shop_code}'").find_by_lookup_type("display_type") + @display_type = Lookup.where("shop_code='#{current_shop.shop_code}'").find_by_lookup_type("display_type") @sale_data = Array.new @@ -49,21 +49,21 @@ class Origami::DashboardController < BaseOrigamiController @print_settings = PrintSetting.get_precision_delimiter() @current_user = current_user #dine-in cashier - dinein_cashier = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('dinein_cashier') + dinein_cashier = Lookup.where("shop_code='#{current_shop.shop_code}'").collection_of('dinein_cashier') @dinein_cashier = 0 if !dinein_cashier[0].nil? @dinein_cashier = dinein_cashier[0][1] end #quick service - quick_service = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('quick_service') + quick_service = Lookup.where("shop_code='#{current_shop.shop_code}'").collection_of('quick_service') @quick_service = 0 if !quick_service[0].nil? @quick_service = quick_service[0][1] end #fourt court - food_court = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('food_court') + food_court = Lookup.where("shop_code='#{current_shop.shop_code}'").collection_of('food_court') @food_court = 0 @food_court_name = nil if !food_court[0].nil? @@ -72,7 +72,7 @@ class Origami::DashboardController < BaseOrigamiController end #order reservation - order_reservation = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('order_reservation') + order_reservation = Lookup.where("shop_code='#{current_shop.shop_code}'").collection_of('order_reservation') @order_reservation = 0 if !order_reservation.empty? order_reservation.each do |order_reserve| @@ -83,7 +83,7 @@ class Origami::DashboardController < BaseOrigamiController end #dashboard settings on/off for supervisor and cashier - dashboard_settings = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('dashboard_settings') + dashboard_settings = Lookup.where("shop_code='#{current_shop.shop_code}'").collection_of('dashboard_settings') @setting_flag = true if !dashboard_settings.empty? dashboard_settings.each do |setting| @@ -94,7 +94,7 @@ class Origami::DashboardController < BaseOrigamiController end #reservation - reservation = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('reservation') + reservation = Lookup.where("shop_code='#{current_shop.shop_code}'").collection_of('reservation') @reservation = 0 if !reservation.empty? reservation.each do |reserve| @@ -114,7 +114,7 @@ def get_all_menu end def get_credit_sales - credit_sales = SalePayment.get_credit_sales(params,@shop.shop_code) + credit_sales = SalePayment.get_credit_sales(params,current_shop.shop_code) if !credit_sales.nil? result = {:status=> true, :data=> credit_sales } else