Fix arg type to preg_replace() with cast

This commit is contained in:
MDW 2024-03-19 15:15:49 +01:00
parent e515cc864d
commit 4c3faabf3c
No known key found for this signature in database

View file

@ -10,6 +10,7 @@
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023 Nick Fragoulis
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -542,7 +543,7 @@ if (empty($reshook)) {
//$tva_npr = $datapriceofproduct['tva_npr'];
$tmpvat = (float) price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', (string) $prod->tva_tx));
// if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ?
if (!empty($price_ht)) {