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:
parent
83cba247a7
commit
b978c9173d
@ -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)
|
||||
outstanding_amount = flt(d.invoice_amount - payment_amount, 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
|
||||
outstanding_amount <= filters.get("outstanding_amt_less_than"))):
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user