18 lines
558 B
Ruby
18 lines
558 B
Ruby
class Origami::CashInsController < BaseOrigamiController
|
|
def new
|
|
end
|
|
|
|
def create
|
|
reference = params[:reference]
|
|
remark = params[:remark]
|
|
amount = params[:amount]
|
|
payment_method = params[:payment_method]
|
|
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
|