From acbed434c28ec0373c3ff4cd5489c7ea75a5581a Mon Sep 17 00:00:00 2001 From: Abhinav Raut Date: Mon, 8 Aug 2022 16:29:13 +0530 Subject: [PATCH 1/2] fix: process loan interest accrual (cherry picked from commit 9ef8d5c5c314ec03f46e982ce8aa36487dbb7559) --- .../doctype/loan_interest_accrual/loan_interest_accrual.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py index ef53303f5a1..1ed80087201 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py @@ -135,7 +135,11 @@ def calculate_accrual_amount_for_demand_loans( def make_accrual_interest_entry_for_demand_loans( posting_date, process_loan_interest, open_loans=None, loan_type=None, accrual_type="Regular" ): - query_filters = {"status": ("in", ["Disbursed", "Partially Disbursed"]), "docstatus": 1} + query_filters = { + "status": ("in", ["Disbursed", "Partially Disbursed"]), + "docstatus": 1, + "is_term_loan": 0, + } if loan_type: query_filters.update({"loan_type": loan_type}) From 8dea238d124299d1ca21cdc7afb277cdf4138a97 Mon Sep 17 00:00:00 2001 From: Abhinav Raut Date: Mon, 8 Aug 2022 17:35:31 +0530 Subject: [PATCH 2/2] fix: term loan interest calculation (cherry picked from commit 534d7ce64b47c6c9272f7bedf79f4cdce825e0f2) --- .../doctype/loan_interest_accrual/loan_interest_accrual.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py index 1ed80087201..c347704b5b0 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py @@ -236,6 +236,7 @@ def get_term_loans(date, term_loan=None, loan_type=None): AND l.is_term_loan =1 AND rs.payment_date <= %s AND rs.is_accrued=0 {0} + AND rs.interest_amount > 0 AND l.status = 'Disbursed' ORDER BY rs.payment_date""".format( condition