shop code
This commit is contained in:
@@ -18,7 +18,7 @@ module LoginVerification
|
||||
|
||||
def current_shop
|
||||
begin
|
||||
shop_code ='262'
|
||||
shop_code ='263'
|
||||
@shop =Shop.find_by_shop_code(shop_code)
|
||||
return @shop
|
||||
rescue
|
||||
@@ -27,28 +27,29 @@ module LoginVerification
|
||||
end
|
||||
|
||||
def current_login_employee
|
||||
@employee = @shop.employees.find_by_token_session(session[:session_token])
|
||||
@employee = Employee.find_by_token_session_and_shop_code(session[:session_token],@shop.shop_code)
|
||||
end
|
||||
|
||||
def current_user
|
||||
@current_user ||= @shop.employees.find_by_token_session(session[:session_token]) if session[:session_token]
|
||||
@current_user ||= Employee.find_by_token_session_and_shop_code(session[:session_token],@shop.shop_code) if session[:session_token]
|
||||
end
|
||||
|
||||
# Get current Cashiers
|
||||
def get_cashier
|
||||
@cashier = @shop.employees.where("role = 'cashier' AND token_session <> ''")
|
||||
@cashier = Employee.where("shop_code='#{@shop.shop_code}' and role = 'cashier' AND token_session <> ''")
|
||||
end
|
||||
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
shop_code ='262'
|
||||
shop_code ='263'
|
||||
@shop = Shop.find_by_shop_code(shop_code)
|
||||
return @shop
|
||||
end
|
||||
|
||||
#check order reservation used
|
||||
def order_reservation
|
||||
order_reserve = @shop.lookups.collection_of('order_reservation')
|
||||
order_reserve = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('order_reservation')
|
||||
status = false
|
||||
if !order_reserve.empty?
|
||||
order_reserve.each do |order|
|
||||
@@ -64,7 +65,7 @@ module LoginVerification
|
||||
|
||||
#check bank integration used
|
||||
def bank_integration
|
||||
bank_integration = @shop.lookups.collection_of('bank_integration')
|
||||
bank_integration = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('bank_integration')
|
||||
status = false
|
||||
if !bank_integration.empty?
|
||||
bank_integration.each do |bank|
|
||||
|
||||
Reference in New Issue
Block a user