diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index 27e3aa83092..61bb2932d2b 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -778,6 +778,8 @@ def get_existing_paid_amount(doctype, name): .where(PL.against_voucher_type.eq(doctype)) .where(PL.against_voucher_no.eq(name)) .where(PL.amount < 0) + .where(PL.delinked == 0) + .where(PER.docstatus == 1) .where(PER.payment_request.isnull()) ) response = query.run()