This commit is contained in:
Nweni
2017-06-28 15:29:44 +06:30
parent 55278c83bc
commit 986655052a
9 changed files with 100 additions and 22 deletions

View File

@@ -19,10 +19,6 @@ class HomeController < ApplicationController
if @employee != nil
session[:session_token] = @employee.token_session
#if cashier => already opening cahshier?
redirect_to origami_root_path
route_by_role(@employee)
else
render :show, flash[:notice] => "Invalid PIN for Employee. Please try again!"
@@ -41,7 +37,7 @@ class HomeController < ApplicationController
redirect_to dashboard_path
elsif @employee.role == "cashier"
session[:session_token] = @employee.token_session
redirect_to origami_root_path
route_by_role(@employee)
elsif @employee.role == "manager"
session[:session_token] = @employee.token_session
redirect_to dashboard_path
@@ -84,13 +80,13 @@ class HomeController < ApplicationController
redirect_to dashboard_path
elsif employee.role == "cashier"
#check if cashier has existing open cashier
# if !ShiftSale.current_open_shift(employee).nil?
# redirect_to origami_root_path
# else
shift = ShiftSale.current_open_shift(employee)
if !shift.nil?
redirect_to origami_root_path
else
redirect_to new_origami_shift_path
# end
elsif employee.role == "checker"
end
elsif employee.role == "manager"
redirect_to oqs_root_path
elsif employee.role == "waiter"
redirect_to oqs_root_path