shift close and payment journal

This commit is contained in:
Min Zeya Phyo
2017-06-28 10:34:42 +06:30
parent c1646b812e
commit ee651763b7
36 changed files with 308 additions and 1 deletions

View File

@@ -19,7 +19,8 @@ class HomeController < ApplicationController
if @employee != nil
session[:session_token] = @employee.token_session
redirect_to origami_root_path
route_by_role(@employee)
else
render :show, flash[:notice] => "Invalid PIN for Employee. Please try again!"
end
@@ -74,4 +75,25 @@ class HomeController < ApplicationController
def settings_home_params
params.require(:login_form).permit(:emp_id, :password)
end
def route_by_role(employee)
if employee.role == "administrator"
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
redirect_to new_origami_shift_path
# end
elsif employee.role == "checker"
redirect_to oqs_root_path
elsif employee.role == "waiter"
redirect_to oqs_root_path
elsif employee.role == "crm"
redirect_to crm_root_path
end
end
end

View File

@@ -0,0 +1,10 @@
class Origami::CashMgmtController < ApplicationController
def index
end
def new
end
def create
end
end

View File

@@ -0,0 +1,13 @@
class Origami::ShiftsController < ApplicationController
def index
end
def show
end
def new
end
def edit
end
end