From eb14d1d31f842cd6a71a85c02e744da743420912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Fri, 1 Apr 2022 16:37:32 +0200 Subject: [PATCH] BUG expedition and warehouse with childen if a warehouse was selected by user, picking is limited to this warehouse and his children (same check is done in products without batch) --- htdocs/expedition/card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 428fb6c7438..8045edde410 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -13,6 +13,7 @@ * Copyright (C) 2016 Yasser Carreón * Copyright (C) 2018 Frédéric France * Copyright (C) 2020 Lenin Rivas + * Copyright (C) 2022 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1459,6 +1460,11 @@ if ($action == 'create') { } foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { + if (!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)) { + // if a warehouse was selected by user, picking is limited to this warehouse and his children + continue; + } + $tmpwarehouseObject->fetch($warehouse_id); if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { foreach ($stock_warehouse->detail_batch as $dbatch) {