Skip to content

Commit

Permalink
TA#64546 [FIX] account_payment_term_discount: Difference in rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
majouda committed Apr 9, 2024
1 parent 371c3b4 commit 096bc73
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
}
)
Expand Down

0 comments on commit 096bc73

Please sign in to comment.