balace onm payment
This commit is contained in:
@@ -42,6 +42,10 @@ class RepaymentsData(db.Model):
|
||||
Add a new repayment data entry.
|
||||
"""
|
||||
try:
|
||||
repaymentAmount = data.get('repaymentAmount', 0.0)
|
||||
amountCollected = data.get('amountCollected',0.0)
|
||||
accountBalance = repaymentAmount - amountCollected
|
||||
|
||||
new_data = cls(
|
||||
transaction_id=data.get('transactionId'),
|
||||
response_code=data.get('responseCode'),
|
||||
@@ -49,8 +53,9 @@ class RepaymentsData(db.Model):
|
||||
fbn_transaction_id=data.get('fbnTransactionId'),
|
||||
account_id=data.get('accountId'),
|
||||
customer_id=data.get('customerId'),
|
||||
amount_collected=data.get('amountCollected'),
|
||||
repayment_amount=data.get('repaymentAmount'),
|
||||
amount_collected=amountCollected,
|
||||
repayment_amount=repaymentAmount,
|
||||
balance=accountBalance
|
||||
)
|
||||
db.session.add(new_data)
|
||||
db.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user