fix: Loan topup test

This commit is contained in:
Deepesh Garg 2020-04-15 11:20:24 +05:30
parent 863d90b8a4
commit 9e9d44d139
2 changed files with 8 additions and 9 deletions

View File

@ -58,18 +58,16 @@ class TestLoanDisbursement(unittest.TestCase):
process_loan_interest_accrual_for_demand_loans(posting_date=add_days(last_date, 1))
# Paid 511095.89 amount includes 5,00,000 principal amount and 11095.89 interest amount
# Should not be able to create loan disbursement entry before repayment
self.assertRaises(frappe.ValidationError, make_loan_disbursement_entry, loan.name,
500000, first_date)
repayment_entry = create_repayment_entry(loan.name, self.applicant, add_days(get_last_day(nowdate()), 5),
"Regular Payment", 611095.89)
repayment_entry.submit()
repayment_entry.submit()
loan.reload()
# After repayment loan disbursement entry should go through
make_loan_disbursement_entry(loan.name, 500000, disbursement_date=add_days(last_date, 16))
total_principal_paid = loan.total_principal_paid
loan.reload()
# Loan Topup will result in decreasing the Total Principal Paid
self.assertEqual(flt(loan.total_principal_paid, 2), flt(total_principal_paid - 500000, 2))

View File

@ -119,6 +119,7 @@
"label": "Penalty Interest Rate (%) Per Day"
},
{
"description": "No. of days from due date until which penalty won't be charged in case of delay in loan repayment",
"fieldname": "grace_period_in_days",
"fieldtype": "Int",
"label": "Grace Period in Days"
@ -142,7 +143,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-02-03 05:03:00.334813",
"modified": "2020-04-15 00:24:43.259963",
"modified_by": "Administrator",
"module": "Loan Management",
"name": "Loan Type",