From 4f343f0863180833ce4c89704da5a8bf14530411 Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Fri, 27 Oct 2023 12:30:03 +0530 Subject: [PATCH] fix: term_loan_accrual_pending (#117) --- .../process_loan_interest_accrual.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.py b/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.py index db1250c7..785a5a1f 100644 --- a/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.py +++ b/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.py @@ -75,7 +75,10 @@ def term_loan_accrual_pending(date, loan=None): filters = {"payment_date": ("<=", date), "is_accrued": 0} if loan: - filters.update({"parent": loan}) + loan_repayment_schedule = frappe.db.get_value( + "Loan Repayment Schedule", {"loan": loan, "status": "Active"} + ) + filters.update({"parent": loan_repayment_schedule}) pending_accrual = frappe.db.get_value("Repayment Schedule", filters)