diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index a9cc1cdc017..d688421979e 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -30,6 +30,7 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formproduct.class.php"); $langs->load("products"); $langs->load("orders"); @@ -47,14 +48,14 @@ if (! $user->rights->produit->lire || ! $product->type == 0 || ! $conf->stock->e * Actions */ -if ($_POST["action"] == "create_stock") +if ($_POST["action"] == "create_stock" && ! $_POST["cancel"]) { $product = new Product($db); $product->id = $_GET["id"]; $product->create_stock($_POST["id_entrepot"], $_POST["nbpiece"]); } -if ($_POST["action"] == "correct_stock" && $_POST["cancel"] <> $langs->trans("Cancel")) +if ($_POST["action"] == "correct_stock" && ! $_POST["cancel"]) { if (is_numeric($_POST["nbpiece"])) { @@ -67,7 +68,7 @@ if ($_POST["action"] == "correct_stock" && $_POST["cancel"] <> $langs->trans("Ca } } -if ($_POST["action"] == "transfert_stock" && $_POST["cancel"] <> $langs->trans("Cancel")) +if ($_POST["action"] == "transfert_stock" && ! $_POST["cancel"]) { if ($_POST["id_entrepot_source"] <> $_POST["id_entrepot_destination"]) { @@ -90,10 +91,14 @@ if ($_POST["action"] == "transfert_stock" && $_POST["cancel"] <> $langs->trans(" } } + /* - * Fiche stock - * + * View */ + +$formproduct=new FormProduct($db); + + if ($_GET["id"] || $_GET["ref"]) { $product = new Product($db); @@ -114,18 +119,18 @@ if ($_GET["id"] || $_GET["ref"]) print '
| '.$langs->trans("Ref").' | '; print $html->showrefnav($product,'ref','',1,'ref'); print ' | '; print '|||
| '.$langs->trans("Label").' | '.$product->libelle.' | '; print '|||
| '.$langs->trans("SellingPrice").' | '; if ($product->price_base_type == 'TTC') { @@ -220,7 +225,7 @@ if ($_GET["id"] || $_GET["ref"]) print ''; /* - * Correction du stock + * Correct stock */ if ($_GET["action"] == "correction") { @@ -232,29 +237,7 @@ if ($_GET["id"] || $_GET["ref"]) // Entrepot print ' | '; - - print ''; - + $formproduct->selectWarehouses($_GET["dwid"],'id_entrepot','',1); print ' | '; print ''; print ' | |