FIX #33563 - Discount amount count twice when create a discount from a deposit invoice (#33564)

This commit is contained in:
lvessiller-opendsi
2025-03-24 01:22:16 +01:00
committed by GitHub
parent 5ffcca92a6
commit f9e42e82d5

View File

@@ -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;