From 096bc732e70201dbbdfb55a89cd75d89f72f5902 Mon Sep 17 00:00:00 2001 From: majouda Date: Tue, 9 Apr 2024 17:47:30 -0400 Subject: [PATCH] TA#64546 [FIX] account_payment_term_discount: Difference in rounding --- .../wizard/account_payment_register.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_payment_term_discount/wizard/account_payment_register.py b/account_payment_term_discount/wizard/account_payment_register.py index f46fac68785a..0d0f23ebec3d 100644 --- a/account_payment_term_discount/wizard/account_payment_register.py +++ b/account_payment_term_discount/wizard/account_payment_register.py @@ -45,7 +45,7 @@ def onchange_payment_amount(self): payment_date = fields.Date.from_string(self.payment_date) discount_amt = self.invoice_id.discount_amt - payment_difference = self.payment_difference + payment_difference = abs(round(self.payment_difference, 2)) self.payment_difference = 0.0 if payment_date <= till_discount_date: @@ -105,7 +105,7 @@ def action_create_payments(self): if payment.payment_difference_handling == "reconcile": payment.invoice_id.write( { - "discount_taken": abs(payment.payment_difference), + "discount_taken": abs(round(payment.payment_difference, 2)), "discount_amt": 0, } )