add junctionpay(vaap)

This commit is contained in:
Yan
2018-03-19 14:38:55 +06:30
parent fa125df355
commit 259778a891
5 changed files with 87 additions and 33 deletions

View File

@@ -11,6 +11,7 @@ class SalePayment < ApplicationRecord
def process_payment(invoice, action_by, cash_amount, payment_method,remark=nil)
self.sale = invoice
self.received_amount = cash_amount
self.payment_reference = remark
amount_due = invoice.grand_total
#get all payment for this invoices
@@ -305,7 +306,7 @@ class SalePayment < ApplicationRecord
#Next time - validate if the vochure number is valid - within
self.payment_method = "JunctionPay"
self.payment_amount = self.received_amount
self.payment_reference = self.voucher_no
# self.payment_reference = self.payment_reference
self.outstanding_amount = self.sale.grand_total- self.received_amount
self.payment_status = "paid"
payment_method = self.save!