From da56360404b9772b1e059eedcfbc264b84ea1687 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Thu, 7 Aug 2025 12:25:59 +0200 Subject: [PATCH] Fix for issue #34891 - wrong Skonto/Escompte calculation (#34892) When foreign currency is involved, the wrong total was used, mixing two currencies when calculating the sum. --- .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index e466edf1deb..0b618907ee3 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -3,7 +3,8 @@ * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Joachim Küter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -804,7 +805,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); $resteapayer = 0; }