From b95ad3f4913c878d7e5a626fc27be04c5843e508 Mon Sep 17 00:00:00 2001 From: Adrien Gallou Date: Thu, 4 Jan 2024 17:24:52 +0100 Subject: [PATCH] correction du calcul du total de la TVA des devis/factures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On ne prenait en compte que la dernière ligne pour chaque taux de TVA. --- sources/Afup/Comptabilite/Facture.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/Afup/Comptabilite/Facture.php b/sources/Afup/Comptabilite/Facture.php index 8c4e09103..451f11297 100644 --- a/sources/Afup/Comptabilite/Facture.php +++ b/sources/Afup/Comptabilite/Facture.php @@ -438,7 +438,7 @@ function genererDevis($reference, $chemin = null) $x += 20; $pdf->SetXY($x, $y); $pdf->MultiCell(20, 5, utf8_decode($detail['tva'] . '%'), 'T', 'C', "C"); - $vatAmounts[$detail['tva']] = ($detail['tva'] / 100) * $montantTtc; + $vatAmounts[$detail['tva']] += ($detail['tva'] / 100) * $montantTtc; $montantTtc = $montantTtc * (1 + ($detail['tva'] / 100)); $x += 20; @@ -636,7 +636,7 @@ function genererFacture($reference, $chemin = null) $x += 20; $pdf->SetXY($x, $y); $pdf->MultiCell(20, 5, utf8_decode($detail['tva'] . '%'), 'T', 'C', "C"); - $vatAmounts[$detail['tva']] = ($detail['tva'] / 100) * $montantTtc; + $vatAmounts[$detail['tva']] += ($detail['tva'] / 100) * $montantTtc; $montantTtc = $montantTtc * (1 + ($detail['tva'] / 100)); }