add alert_time_min in api/checkin and check for waiter login
This commit is contained in:
@@ -11,7 +11,17 @@ class Api::CheckInProcessController < Api::ApiController
|
||||
check_in_time = booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
|
||||
check_out_time = booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
|
||||
|
||||
render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time }
|
||||
lookup_checkout_time = Lookup.collection_of("checkout_alert_time")
|
||||
alert_time_min = 0
|
||||
if !lookup_checkout_time.nil?
|
||||
if lookup_checkout_time[0][0] == 'min'
|
||||
alert_time_min = (lookup_checkout_time[0][1]).to_i
|
||||
else
|
||||
alert_time_min = 15
|
||||
end
|
||||
end
|
||||
|
||||
render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time, :alert_time_min => alert_time_min }
|
||||
else
|
||||
render :json => { :status => false, :error_message => "No current booking!" }
|
||||
end
|
||||
|
||||
@@ -3,7 +3,8 @@ class HomeController < ApplicationController
|
||||
skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy]
|
||||
|
||||
def index
|
||||
@employees = Employee.all_emp_except_waiter.order("name asc")
|
||||
# @employees = Employee.all_emp_except_waiter.order("name asc")
|
||||
@employees = Employee.all.order("name asc")
|
||||
@login_form = LoginForm.new()
|
||||
render "layouts/login_dashboard", layout: false
|
||||
end
|
||||
@@ -45,7 +46,7 @@ class HomeController < ApplicationController
|
||||
elsif @employee.role == "manager"
|
||||
session[:session_token] = @employee.token_session
|
||||
redirect_to dashboard_path
|
||||
elsif @employee.role == "supervisor"
|
||||
elsif @employee.role == "supervisor" || @employee.role == "waiter"
|
||||
session[:session_token] = @employee.token_session
|
||||
redirect_to origami_root_path
|
||||
elsif @employee.role == "account"
|
||||
|
||||
Reference in New Issue
Block a user