update cash in and out for quick service
This commit is contained in:
@@ -8,31 +8,32 @@ class Origami::CashInsController < BaseOrigamiController
|
||||
amount = params[:amount]
|
||||
payment_method = params[:payment_method]
|
||||
payment_method_reference = params[:payment_method_reference]
|
||||
type = params[:type]
|
||||
p_jour = PaymentJournal.new
|
||||
p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user.id)
|
||||
shift = ShiftSale.current_open_shift(current_user.id)
|
||||
|
||||
current_shift = ShiftSale.current_shift
|
||||
|
||||
# set cashier
|
||||
# set cashier
|
||||
if shift != nil
|
||||
shift = shift
|
||||
else
|
||||
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||
if open_cashier.count>0
|
||||
|
||||
shift = ShiftSale.current_open_shift(open_cashier[0].id)
|
||||
|
||||
if shift
|
||||
shift = ShiftSale.current_open_shift(shift.id)
|
||||
else
|
||||
shift = ShiftSale.current_open_shift(current_shift.id)
|
||||
end
|
||||
else
|
||||
shift = Employee.find(current_shift.employee_id).name
|
||||
|
||||
end
|
||||
shift = ShiftSale.current_open_shift(open_cashier[0].id)
|
||||
|
||||
if shift
|
||||
shift = ShiftSale.current_open_shift(shift.id)
|
||||
else
|
||||
shift = ShiftSale.current_open_shift(current_shift.id)
|
||||
end
|
||||
else
|
||||
shift = Employee.find(current_shift.employee_id).name
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
shift.cash_in = shift.cash_in + amount.to_f
|
||||
shift.save
|
||||
|
||||
@@ -62,7 +62,13 @@ class Origami::PendingOrderController < BaseOrigamiController
|
||||
@table_id = nil
|
||||
@dining = nil
|
||||
end
|
||||
end
|
||||
|
||||
def cash_ins
|
||||
render "origami/cash_ins/new"
|
||||
end
|
||||
def cash_outs
|
||||
render "origami/cash_outs/new"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user