dashboard
This commit is contained in:
@@ -3,7 +3,7 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
def index
|
def index
|
||||||
today = DateTime.now.strftime('%Y-%m-%d')
|
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
|
@sale_data = Array.new
|
||||||
|
|
||||||
@@ -49,21 +49,21 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
@print_settings = PrintSetting.get_precision_delimiter()
|
@print_settings = PrintSetting.get_precision_delimiter()
|
||||||
@current_user = current_user
|
@current_user = current_user
|
||||||
#dine-in cashier
|
#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
|
@dinein_cashier = 0
|
||||||
if !dinein_cashier[0].nil?
|
if !dinein_cashier[0].nil?
|
||||||
@dinein_cashier = dinein_cashier[0][1]
|
@dinein_cashier = dinein_cashier[0][1]
|
||||||
end
|
end
|
||||||
|
|
||||||
#quick service
|
#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
|
@quick_service = 0
|
||||||
if !quick_service[0].nil?
|
if !quick_service[0].nil?
|
||||||
@quick_service = quick_service[0][1]
|
@quick_service = quick_service[0][1]
|
||||||
end
|
end
|
||||||
|
|
||||||
#fourt court
|
#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 = 0
|
||||||
@food_court_name = nil
|
@food_court_name = nil
|
||||||
if !food_court[0].nil?
|
if !food_court[0].nil?
|
||||||
@@ -72,7 +72,7 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
#order reservation
|
#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
|
@order_reservation = 0
|
||||||
if !order_reservation.empty?
|
if !order_reservation.empty?
|
||||||
order_reservation.each do |order_reserve|
|
order_reservation.each do |order_reserve|
|
||||||
@@ -83,7 +83,7 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
#dashboard settings on/off for supervisor and cashier
|
#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
|
@setting_flag = true
|
||||||
if !dashboard_settings.empty?
|
if !dashboard_settings.empty?
|
||||||
dashboard_settings.each do |setting|
|
dashboard_settings.each do |setting|
|
||||||
@@ -94,7 +94,7 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
#reservation
|
#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
|
@reservation = 0
|
||||||
if !reservation.empty?
|
if !reservation.empty?
|
||||||
reservation.each do |reserve|
|
reservation.each do |reserve|
|
||||||
@@ -114,7 +114,7 @@ def get_all_menu
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_credit_sales
|
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?
|
if !credit_sales.nil?
|
||||||
result = {:status=> true, :data=> credit_sales }
|
result = {:status=> true, :data=> credit_sales }
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user