This commit is contained in:
Nweni
2017-06-29 18:59:17 +06:30
parent 11c3be8f4a
commit 8046bc7745
9 changed files with 119 additions and 69 deletions

View File

@@ -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