From dc0e5e8d893ede8039b8d34cec614fb8392a84d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Aug 2022 10:59:15 +0200 Subject: [PATCH] keep batch info when correcting stock --- .../product/stock/tpl/stockcorrection.tpl.php | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 08a66d1b8c6..eb927756263 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -41,6 +41,19 @@ if (empty($id)) { $id = $object->id; } +$pdluoid = GETPOST('pdluoid', 'int'); + +$pdluo = new Productbatch($db); + +if ($pdluoid > 0) { + $result = $pdluo->fetch($pdluoid); + if ($result > 0) { + $pdluoid = $pdluo->id; + } else { + dol_print_error($db, $pdluo->error, $pdluo->errors); + } +} + print '