From d82a0a9455e83ad6dadd15e8bfa7dad59e36c0f8 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Thu, 26 Feb 2026 14:28:25 +0530 Subject: [PATCH] fix(payment_entry): fix precision for `total_allocated_amount` and `base_total_allocated_amount` Co-authored-by: Ahuahuachi --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 85c0342df21..31d6a1a7f5a 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -1065,8 +1065,12 @@ class PaymentEntry(AccountsController): total_allocated_amount += flt(d.allocated_amount) base_total_allocated_amount += self.calculate_base_allocated_amount_for_reference(d) - self.total_allocated_amount = abs(total_allocated_amount) - self.base_total_allocated_amount = abs(base_total_allocated_amount) + self.total_allocated_amount = flt( + abs(total_allocated_amount), self.precision("total_allocated_amount") + ) + self.base_total_allocated_amount = flt( + abs(base_total_allocated_amount), self.precision("base_total_allocated_amount") + ) def set_unallocated_amount(self): self.unallocated_amount = 0