shop code
This commit is contained in:
@@ -7,28 +7,29 @@ class Origami::CashOutsController < BaseOrigamiController
|
||||
remark = params[:remark]
|
||||
amount = params[:amount]
|
||||
p_jour = PaymentJournal.new
|
||||
p_jour.cash_out(reference, remark, amount, current_user.id)
|
||||
shift = ShiftSale.current_open_shift(current_user.id)
|
||||
|
||||
current_shift = ShiftSale.current_shift
|
||||
p_jour.cash_out(reference, remark, amount, current_user)
|
||||
shift = ShiftSale.current_open_shift(current_user)
|
||||
|
||||
current_shift = ShiftSale.current_shift(@shop.shop_code)
|
||||
|
||||
# set cashier
|
||||
if shift != nil
|
||||
shift = shift
|
||||
else
|
||||
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||
open_cashier = Employee.where("shop_code='#{@shop.shop_code}' and role = 'cashier' AND token_session <> ''")
|
||||
if open_cashier.count>0
|
||||
|
||||
shift = ShiftSale.current_open_shift(open_cashier[0].id)
|
||||
|
||||
|
||||
shift = ShiftSale.current_open_shift(open_cashier[0])
|
||||
|
||||
if shift
|
||||
shift = ShiftSale.current_open_shift(shift.id)
|
||||
emp = Employee.find_by_id(shift.employee_id)
|
||||
shift = ShiftSale.current_open_shift(emp)
|
||||
else
|
||||
shift = ShiftSale.current_open_shift(current_shift.id)
|
||||
shift = ShiftSale.current_open_shift(current_shift)
|
||||
end
|
||||
else
|
||||
shift = Employee.find(current_shift.employee_id).name
|
||||
|
||||
# shift = Employee.find(current_shift.employee_id).name
|
||||
shift =current_shift
|
||||
end
|
||||
end
|
||||
shift.cash_out = shift.cash_out + amount.to_i
|
||||
|
||||
Reference in New Issue
Block a user