food court cashier

This commit is contained in:
yarzar_code
2020-01-14 18:09:40 +06:30
parent 3f338f2073
commit 49e3065866
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