From f61b7c03f7ff6a16534b4df494305f022e0741c0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 10 Nov 2007 21:37:17 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20on=20affiche=20les=20options=20que=20si?= =?UTF-8?q?=20le=20module=20est=20activ=E9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/stock.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index e18309eebcd..faf4a8828cd 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -59,8 +59,8 @@ elseif ($_POST["action"] == 'stock_bill') //Si activée on désactive la décrémentation du stock à la validation de commande et/ou à l'expédition if ($_POST["stock_bill"] == 1) { - dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", 0); - dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", 0); + if ($conf->commande->enabled) dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", 0); + if ($conf->expedition->enabled) dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", 0); } Header("Location: stock.php"); exit; @@ -71,8 +71,8 @@ elseif ($_POST["action"] == 'stock_validateorder') //Si activée on désactive la décrémentation du stock à la facturation et/ou à l'expédition if ($_POST["stock_validateorder"] == 1) { - dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", 0); - dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", 0); + if ($conf->facture->enabled) dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", 0); + if ($conf->expedition->enabled) dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", 0); } Header("Location: stock.php"); exit; @@ -83,8 +83,8 @@ elseif ($_POST["action"] == 'stock_shipment') //Si activée on désactive la décrémentation du stock à la facturation et/ou à la validation de commande if ($_POST["stock_shipment"] == 1) { - dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", 0); - dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", 0); + if ($conf->facture->enabled) dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", 0); + if ($conf->commande->enabled) dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", 0); } Header("Location: stock.php"); exit;