mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 21:59:13 +00:00
fix: added null check for filters (#18416)
filters when None, at `filters.get("outstanding_amt_greater_than")` would result in an Attribute Error. This PR just adds a simple null-check in the if conditions. I'm awesome!
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
@@ -690,7 +690,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None, filters
|
|||||||
payment_amount = pe_map.get((d.voucher_type, d.voucher_no), 0)
|
payment_amount = pe_map.get((d.voucher_type, d.voucher_no), 0)
|
||||||
outstanding_amount = flt(d.invoice_amount - payment_amount, precision)
|
outstanding_amount = flt(d.invoice_amount - payment_amount, precision)
|
||||||
if outstanding_amount > 0.5 / (10**precision):
|
if outstanding_amount > 0.5 / (10**precision):
|
||||||
if (filters.get("outstanding_amt_greater_than") and
|
if (filters and filters.get("outstanding_amt_greater_than") and
|
||||||
not (outstanding_amount >= filters.get("outstanding_amt_greater_than") and
|
not (outstanding_amount >= filters.get("outstanding_amt_greater_than") and
|
||||||
outstanding_amount <= filters.get("outstanding_amt_less_than"))):
|
outstanding_amount <= filters.get("outstanding_amt_less_than"))):
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user