From ebdacc094c47aa334282b5f75cc194e6c25d48ad 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 (cherry picked from commit 561a159aec1d71125fa0b1779df5ac1ff111b0da) --- 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 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()