mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
fix: include entries with null finance book
This commit is contained in:
@@ -303,14 +303,23 @@ def get_balance_on(
|
|||||||
if finance_book:
|
if finance_book:
|
||||||
if default_finance_book and include_default_fb_balances:
|
if default_finance_book and include_default_fb_balances:
|
||||||
cond.append(
|
cond.append(
|
||||||
f"gle.finance_book IN ({frappe.db.escape(finance_book)}, {frappe.db.escape(default_finance_book)})"
|
f"""(gle.finance_book IN (
|
||||||
|
{frappe.db.escape(finance_book)},
|
||||||
|
{frappe.db.escape(default_finance_book)}
|
||||||
|
)OR gle.finance_book IS NULL
|
||||||
|
)"""
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
cond.append(f"gle.finance_book = {frappe.db.escape(finance_book)}")
|
cond.append(f"(gle.finance_book = {frappe.db.escape(finance_book)} OR gle.finance_book IS NULL)")
|
||||||
|
|
||||||
elif default_finance_book and include_default_fb_balances:
|
elif default_finance_book and include_default_fb_balances:
|
||||||
# No finance book passed → fall back to default
|
# No finance book passed → fall back to default
|
||||||
cond.append(f"gle.finance_book = {frappe.db.escape(default_finance_book)}")
|
cond.append(
|
||||||
|
f"""(
|
||||||
|
gle.finance_book = {frappe.db.escape(default_finance_book)}
|
||||||
|
OR gle.finance_book IS NULL
|
||||||
|
)"""
|
||||||
|
)
|
||||||
|
|
||||||
if account or (party_type and party) or account_type:
|
if account or (party_type and party) or account_type:
|
||||||
precision = get_currency_precision()
|
precision = get_currency_precision()
|
||||||
|
|||||||
Reference in New Issue
Block a user