Merge pull request #23301 from deepeshgarg007/closed_loan_amount
fix: Amount for closed loans
This commit is contained in:
commit
dc84633860
@ -317,6 +317,11 @@ class TestLoan(unittest.TestCase):
|
||||
self.assertEqual(loan.status, 'Closed')
|
||||
self.assertEquals(sum(pledged_qty.values()), 0)
|
||||
|
||||
amounts = amounts = calculate_amounts(loan.name, add_days(last_date, 6), "Regular Repayment")
|
||||
self.assertEqual(amounts['pending_principal_amount'], 0)
|
||||
self.assertEqual(amounts['payable_principal_amount'], 0)
|
||||
self.assertEqual(amounts['interest_amount'], 0)
|
||||
|
||||
def test_disbursal_check_with_shortfall(self):
|
||||
pledges = [{
|
||||
"loan_security": "Test Security 2",
|
||||
|
@ -327,7 +327,7 @@ def get_amounts(amounts, against_loan, posting_date, payment_type):
|
||||
if not final_due_date:
|
||||
final_due_date = add_days(due_date, loan_type_details.grace_period_in_days)
|
||||
|
||||
if against_loan_doc.status in ('Disbursed', 'Loan Closure Requested'):
|
||||
if against_loan_doc.status in ('Disbursed', 'Loan Closure Requested', 'Closed'):
|
||||
pending_principal_amount = against_loan_doc.total_payment - against_loan_doc.total_principal_paid - against_loan_doc.total_interest_payable
|
||||
else:
|
||||
pending_principal_amount = against_loan_doc.disbursed_amount
|
||||
|
Loading…
x
Reference in New Issue
Block a user