From 61363d2ceda3934224404daf3acf9d4bf23dc373 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 30 Apr 2020 22:22:44 +0530 Subject: [PATCH] fix: Initialize interest_paid as zero --- erpnext/loan_management/doctype/loan_repayment/loan_repayment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py index ed1eed236d..a5ed5de30e 100644 --- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py @@ -106,6 +106,7 @@ class LoanRepayment(AccountsController): def allocate_amounts(self, paid_entries): self.set('repayment_details', []) self.principal_amount_paid = 0 + interest_paid = 0 if self.amount_paid - self.penalty_amount > 0 and paid_entries: interest_paid = self.amount_paid - self.penalty_amount