From 1de0c46c5198c66a28d9e7f6d3d6fe8693af7aa7 Mon Sep 17 00:00:00 2001 From: l0gesh29 Date: Fri, 19 Sep 2025 19:29:43 +0530 Subject: [PATCH] fix: include precision in validation --- .../accounts/doctype/payment_request/payment_request.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index cafd2e4b721..f970690016f 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -129,7 +129,13 @@ class PaymentRequest(Document): existing_payment_request_amount = flt(get_existing_payment_request_amount(ref_doc)) - if existing_payment_request_amount + flt(self.grand_total) > ref_amount: + if ( + flt( + existing_payment_request_amount + flt(self.grand_total, self.precision("grand_total")), + get_currency_precision(), + ) + > ref_amount + ): frappe.throw( _("Total Payment Request amount cannot be greater than {0} amount").format( self.reference_doctype