From 6a3885daec152be02246d9ed09c5ff1314bd8dc7 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 26 Nov 2004 16:22:48 +0000 Subject: [PATCH] Ajout fonction de transfert temporaire --- htdocs/product/stock/product.php | 81 ++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 3 deletions(-) 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 "
id\" method=\"post\">\n"; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print '
SourceDestinationNb de pièce
 '; + print '
'; + print '
'; + + } + /* + * * */ if ($_GET["action"] == "definir") @@ -275,8 +349,9 @@ else print "
\n"; -if ($_GET["action"] <> 'correction') +if ($_GET["action"] == '' ) { + print 'Transfert'; print 'Correction stock'; } print '
';