From 2b255bdddbe4ed343b8ca1deee8107ffca42201d Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 27 Jun 2022 19:18:13 +0530 Subject: [PATCH] fix: Bank Statement loan amount query --- .../bank_reconciliation_statement.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py index c26eddeac6a..fbc1a69ddc5 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py @@ -276,14 +276,13 @@ def get_loan_amount(filters): frappe.qb.from_(loan_doc) .select(amount_field) .where(loan_doc.docstatus == 1) - .where(salary_condition) .where(account == filters.get("account")) .where(posting_date > getdate(filters.get("report_date"))) .where(ifnull(loan_doc.clearance_date, "4000-01-01") <= getdate(filters.get("report_date"))) ) if doctype == "Loan Repayment" and frappe.db.has_column("Loan Repayment", "repay_from_salary"): - query = query.run((loan_doc.repay_from_salary == 0)) + query = query.where((loan_doc.repay_from_salary == 0)) amount = query.run()[0][0] total_amount += flt(amount)