From 561a159aec1d71125fa0b1779df5ac1ff111b0da Mon Sep 17 00:00:00 2001 From: Sugesh393 Date: Fri, 29 Nov 2024 17:39:40 +0530 Subject: [PATCH] fix: calculate submitted payment entry as paid amount --- erpnext/accounts/doctype/payment_request/payment_request.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index 6f0972eb3c6..4e0c994b798 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -783,6 +783,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()