From eda61879821af0f2d4bd9f00ee47e88aa099e1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20de=20Chateauvieux?= Date: Thu, 28 Mar 2013 09:30:42 +0400 Subject: [PATCH] TVA NPR : can use * in tva when set supplier price --- htdocs/product/fournisseurs.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 43929c96b0c..97011f44c30 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -95,7 +95,9 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn"); $quantity=GETPOST("qty"); $remise_percent=price2num(GETPOST('remise_percent','alpha')); - $tva_tx=price2num(GETPOST('tva_tx','alpha')); + $npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0 ; + $tva_tx = str_replace('*','', GETPOST('tva_tx','alpha')); + $tva_tx = price2num($tva_tx); if (empty($quantity)) { @@ -156,7 +158,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) if (isset($_POST['ref_fourn_price_id'])) $product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); - $ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent); + $ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, $npr); if ($ret < 0) { $error++; @@ -527,4 +529,4 @@ else // End of page llxFooter(); $db->close(); -?> \ No newline at end of file +?>