From 9c8145eb885059218815bd4efa92e252aa4c4e23 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2016 19:19:13 +0200 Subject: [PATCH] Better fix for 416a0892d75438a4083c94176d803a5c723d8fa9 --- htdocs/product/price.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index ef807d2f603..8c3ad45c90c 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -97,8 +97,6 @@ if (empty($reshook)) { $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 - $tva_tx_txt; - // We must define tva_tx, npr and local taxes $tva_tx = preg_replace('/[^0-9\.].*$/', '', $tva_tx_txt); // keep remove all after the numbers and dot $npr = preg_match('/\*/', $tva_tx_txt) ? 1 : 0; @@ -204,6 +202,7 @@ if (empty($reshook)) } $tva_tx_txt = $newvattx[$i]; + $tva_tx = preg_replace('/[^0-9\.].*$/', '', $tva_tx_txt); // keep remove all after the numbers and dot $npr = $newvatnpr[$i]; $localtax1 = $newlocaltax1_tx[$i]; $localtax1_type = $newlocaltax1_type[$i]; @@ -214,7 +213,7 @@ if (empty($reshook)) 'price' => $newprice[$i], 'price_min' => $newprice_min[$i], 'price_base_type' => $newpricebase[$i], - 'vat_tx' => $tva_tx_txt, + 'vat_tx' => $tva_tx, 'npr' => $npr, 'localtaxes_array' => array('0'=>$localtax1_type, '1'=>$localtax1, '2'=>$localtax2_type, '3'=>$localtax2) );