Fetch Outstanding Invoices filters on Payment Entry does not work on negative outstanding invoices

While using Fetch Outstanding Invoices feature on Payment Entry, Invoice From Date, To Date, Currency etc filters does not work on credit / debit notes (invoices with negative outstanding invoices). However, these filters work on normal invoices.

get_outstanding_reference_documents(args) method of apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py handles filters on positive outstanding sales / purchase invoices, Fees. But these filters are not handled in get_negative_outstanding_invoices method.

Not handling filters on negative outstanding invoices is intentional behaviour?


This is still an issue for us as well. We have to manually add outstanding (unapplied) credit notes (return Sales Invoices)

ERPNext just looks at the G/L Account type, and based on that decides if it needs to look at positive or negative invoices

Still the same in v13 beta

	if party_account_type == 'Receivable':
		dr_or_cr = "debit_in_account_currency - credit_in_account_currency"