diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php index c052377fc92..8eaf9523c46 100644 --- a/htdocs/margin/lib/margins.lib.php +++ b/htdocs/margin/lib/margins.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2012 Christophe Battarel * Copyright (C) 2014-2015 Marcos GarcĂ­a * Copyright (C) 2016 Florian Henry + * Copyright (C) 2024 MDW * * 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 @@ -142,7 +143,7 @@ function getMarginInfos($pv_ht, $remise_percent, $tva_tx, $localtax1_tx, $localt // calcul marge if ($pu_ht_remise < 0) { - $marge = -1 * (abs($pu_ht_remise) - $pa_ht_ret); + $marge = -1 * (abs((float) $pu_ht_remise) - $pa_ht_ret); } else { $marge = $pu_ht_remise - $pa_ht_ret; }