shift open/close

This commit is contained in:
Nweni
2017-06-29 13:35:09 +06:30
parent 45961880c8
commit 618a89472a
20 changed files with 320 additions and 18 deletions

View File

@@ -1,2 +1,22 @@
class PaymentJournal < ApplicationRecord
def cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user)
self.payment_references = reference
self.remark = remark
self.credit_amount = amount
self.payment_method = payment_method
self.payment_status = 'paid'
self.payment_method_references = payment_method_reference
self.created_by = current_user
self.save
end
def cash_out(payment_reference, remark, amount, current_user)
self.payment_references = payment_reference
self.remark = remark
self.debit_amount = amount
self.payment_status = 'paid'
self.created_by = current_user
self.save
end
end