mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 08:35:00 +00:00
fix: Bank Statement loan amount query
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user