diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index e8226a7ab66..fe285b6aed6 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -68,6 +68,29 @@ if ($_POST["action"] == "correct_stock" && $_POST["cancel"] <> $langs->trans("Ca } } +if ($_POST["action"] == "transfert_stock" && $_POST["cancel"] <> $langs->trans("Cancel")) +{ + if ($_POST["id_entrepot_source"] <> $_POST["id_entrepot_destination"]) + { + if (is_numeric($_POST["nbpiece"])) + { + + $product = new Product($db); + $product->id = $_GET["id"]; + + $product->correct_stock($user, + $_POST["id_entrepot_source"], + $_POST["nbpiece"], + 1); + + $product->correct_stock($user, + $_POST["id_entrepot_destination"], + $_POST["nbpiece"], + 0); + } + } +} + /* * Fiche stock * @@ -227,9 +250,60 @@ if ($_GET["id"]) print ''; } - /* - * Correction du stock + * Transfert de pièces + * + */ + if ($_GET["action"] == "transfert") + { + print_titre ("Transfert de stock"); + print "
'; + + } + /* + * * */ if ($_GET["action"] == "definir") @@ -275,8 +349,9 @@ else print "