Merge branch 'foodcourt' of gitlab.com:code2lab/SXRestaurant into HEAD

This commit is contained in:
Myat Zin Wai Maw
2020-01-14 18:11:09 +06:30
8 changed files with 34 additions and 21 deletions

View File

@@ -199,13 +199,22 @@ class HomeController < ApplicationController
redirect_to dashboard_path
end
elsif employee.role == "cashier"
food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")
#check if cashier has existing open cashier
shift = ShiftSale.current_open_shift(employee)
if !shift.nil?
redirect_to origami_dashboard_path
# redirect_to origami_root_path
if food_court
if !shift.nil?
redirect_to foodcourt_food_court_path
else
redirect_to new_foodcourt_shift_path
end
else
redirect_to new_origami_shift_path
if !shift.nil?
redirect_to origami_dashboard_path
# redirect_to origami_root_path
else
redirect_to new_origami_shift_path
end
end
elsif employee.role == "manager"
redirect_to dashboard_path