shift
This commit is contained in:
@@ -11,5 +11,8 @@ class Origami::CashInsController < BaseOrigamiController
|
||||
payment_method_reference = params[:payment_method_reference]
|
||||
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)
|
||||
shift.cash_in = shift.cash_in + amount.to_i
|
||||
shift.save
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,5 +9,8 @@ class Origami::CashOutsController < BaseOrigamiController
|
||||
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)
|
||||
shift.cash_out = shift.cash_out + amount.to_i
|
||||
shift.save
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,9 +18,12 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def update_shift
|
||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||
closing_balance = params[:closing_balance]
|
||||
shift_id = params[:shift_id]
|
||||
@shift = ShiftSale.find_by_id(shift_id)
|
||||
if @shift
|
||||
@shift.shift_closed_at = DateTime.now.utc
|
||||
@shift.closing_balance = closing_balance.to_f
|
||||
@shift.save
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user