From 94de6f5ea7099baf2894b91a0d62003818107775 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+BB2A-Anthony@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:15:01 +0100 Subject: [PATCH] NEW - replenishment if the warehouse is set to the default selected user (#31229) * NEW - replenishment if the warehouse is set to the default selected user * FIX --------- Co-authored-by: Anthony Berton --- htdocs/product/stock/replenish.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index f8ad4f06ce3..ebad79a6d09 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -86,6 +86,10 @@ while ($tmpobj = $db->fetch_object($resWar)) { if ($count == 1 && (empty($fk_entrepot) || $fk_entrepot <= 0) && getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { $fk_entrepot = $lastWarehouseID; } +//If the warehouse is set to the default selected user +if (!GETPOSTISSET('fk_warehouse') && (empty($fk_entrepot) || $fk_entrepot <= 0) && getDolGlobalString('MAIN_DEFAULT_WAREHOUSE_USER')) { + $fk_entrepot = $user->fk_warehouse; +} $texte = '';