shift
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -19,9 +19,9 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@orders = Order.get_orders()
|
||||
end
|
||||
|
||||
def item_show
|
||||
selection(params[:booking_id],1)
|
||||
end
|
||||
# def item_show
|
||||
# selection(params[:booking_id],1)
|
||||
# end
|
||||
|
||||
def selection(selected_id, is_ajax)
|
||||
str = []
|
||||
@@ -37,8 +37,8 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@order_details = OrderItem.get_order_items_details(params[:booking_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if is_ajax == 1
|
||||
render :json => str.to_json
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Origami::ShiftsController < ApplicationController
|
||||
class Origami::ShiftsController < BaseOrigamiController
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
@@ -6,6 +7,13 @@ class Origami::ShiftsController < ApplicationController
|
||||
end
|
||||
|
||||
def new
|
||||
@float = Lookup.where('lookup_type=?','float')
|
||||
end
|
||||
|
||||
def create
|
||||
opening_balance = params[:opening_balance]
|
||||
@shift = ShiftSale.new
|
||||
@shift.create(opening_balance,current_user)
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
Reference in New Issue
Block a user