add kitchen role for oqs

This commit is contained in:
Aung Myo
2018-04-07 15:53:24 +06:30
parent 7b28d56738
commit 14b33a6f8d
6 changed files with 92 additions and 3 deletions

View File

@@ -164,6 +164,9 @@ For CloseCashierCustomisePdf in lookups
3) settings/lookups => { type:tax_profiles, name: Doemal, value: doemal }
/* Tax Profile Group Types in lookups */
Add Kitchen Role of Employee
=> 1) settings/lookups => { type:employee_roles, name: Kitchen, value:kitchen }
* ToDo list
1. Migration

View File

@@ -70,6 +70,9 @@ class HomeController < ApplicationController
elsif @employee.role == "account"
session[:session_token] = @employee.token_session
redirect_to reports_dailysale_index_path
elsif @employee.role == "kitchen"
session[:session_token] = @employee.token_session
redirect_to oqs_root_path
else
render :index
end

View File

@@ -1,4 +1,5 @@
class Oqs::EditController < BaseOqsController
authorize_resource :class => false
def index
assigned_item_id = params[:id]
@link_type = params[:type]

View File

@@ -1,8 +1,6 @@
class Oqs::HomeController < BaseOqsController
authorize_resource :class => false
def index
# Query for OQS with delivery status false
# @queue_items_details = queue_items_query(false)

View File

@@ -1,4 +1,5 @@
class Oqs::PrintController < ApplicationController
authorize_resource :class => false
# Print Order Item
def print
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server

View File

@@ -98,6 +98,22 @@ class Ability
can :create, :split_bill
can :update_sale, :split_bill
#oqs Home
can :index, :home
can :index, :show
can :get_order_items, :home
can :get_items_by_oqs, :home
can :update_delivery_status, :home
can :queue_items_query, :home
can :completed_order, :home
can :queue_items_count_query, :home
can :index, :edit
can :update, :edit
can :print, :print
can :print_order_summary, :print
elsif user.role == "cashier"
# can :overall_void, :void
@@ -144,6 +160,22 @@ class Ability
can :index, :split_bill
can :create, :split_bill
can :update_sale, :split_bill
#oqs Home
can :index, :home
can :index, :show
can :get_order_items, :home
can :get_items_by_oqs, :home
can :update_delivery_status, :home
can :queue_items_query, :home
can :completed_order, :home
can :queue_items_count_query, :home
can :index, :edit
can :update, :edit
can :print, :print
can :print_order_summary, :print
elsif user.role == "account"
@@ -201,6 +233,23 @@ class Ability
can :index, :split_bill
can :create, :split_bill
can :update_sale, :split_bill
#oqs Home
can :index, :home
can :index, :show
can :get_order_items, :home
can :get_items_by_oqs, :home
can :update_delivery_status, :home
can :queue_items_query, :home
can :completed_order, :home
can :queue_items_count_query, :home
can :index, :edit
can :update, :edit
can :print, :print
can :print_order_summary, :print
elsif user.role == "waiter"
can :index, :home
can :show, :home
@@ -227,6 +276,40 @@ class Ability
#ability for split_bill
can :index, :split_bill
can :create, :split_bill
#oqs Home
can :index, :home
can :index, :show
can :get_order_items, :home
can :get_items_by_oqs, :home
can :update_delivery_status, :home
can :queue_items_query, :home
can :completed_order, :home
can :queue_items_count_query, :home
can :index, :edit
can :update, :edit
can :print, :print
can :print_order_summary, :print
elsif user.role == "kitchen"
#oqs Home
can :index, :home
can :index, :show
can :get_order_items, :home
can :get_items_by_oqs, :home
can :update_delivery_status, :home
can :queue_items_query, :home
can :completed_order, :home
can :queue_items_count_query, :home
can :index, :edit
can :update, :edit
can :print, :print
can :print_order_summary, :print
end
end
end