diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index bbbbe0b6f9d..5da1c0d35d9 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -165,6 +165,10 @@ frappe.ui.form.on('Payment Entry', { filters: { reference_doctype: row.reference_doctype, reference_name: row.reference_name, + company: doc.company, + status: ["!=", "Paid"], + outstanding_amount: [">", 0], // for compatibility with old data + docstatus: 1, }, }; }); diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index d949f7857c1..68055546c24 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -848,12 +848,7 @@ def get_open_payment_requests_query(doctype, txt, searchfield, start, page_len, open_payment_requests = frappe.get_list( "Payment Request", - filters={ - **filters, - "status": ["!=", "Paid"], - "outstanding_amount": ["!=", 0], # for compatibility with old data - "docstatus": 1, - }, + filters=filters, fields=["name", "grand_total", "outstanding_amount"], order_by="transaction_date ASC,creation ASC", )