From f9e42e82d58f2c08f2ecdb4d1fdf07a0b63ce6e1 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Mon, 24 Mar 2025 01:22:16 +0100 Subject: [PATCH] FIX #33563 - Discount amount count twice when create a discount from a deposit invoice (#33564) --- htdocs/compta/paiement/class/paiement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index a0fdf379332..33513cbaa56 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -541,7 +541,7 @@ class Paiement extends CommonObject // Loop on each vat rate $i = 0; foreach ($invoice->lines as $line) { - if ($line->total_ht != 0) { // no need to create discount if amount is null + if ($line->product_type != 9 && $line->total_ht != 0) { // no need to create discount if amount is null or is special product if (!array_key_exists($line->tva_tx, $amount_ht)) { $amount_ht[$line->tva_tx] = 0.0; $amount_tva[$line->tva_tx] = 0.0;