From cb5b739886b90265df8dbdce2afd9b6ede79c534 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 18 Apr 2022 17:59:20 +0200 Subject: [PATCH] Handle splitted stock entries + optimized/unified product property checks --- services/StockService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/StockService.php b/services/StockService.php index 804040ca..c184605f 100644 --- a/services/StockService.php +++ b/services/StockService.php @@ -1058,12 +1058,12 @@ class StockService extends BaseService $amount = 0; } - if ($product->move_on_open) + if ($product->move_on_open == 1) { $locationIdTo = $product->default_consume_location_id; - if ($locationIdTo && $locationIdTo !== $stockEntry->location_id) + if (!empty($locationIdTo) && $locationIdTo != $stockEntry->location_id) { - $this->TransferProduct($stockEntry->product_id, $amount, $stockEntry->location_id, $locationIdTo, $stockEntry->stock_id, $transactionId); + $this->TransferProduct($stockEntry->product_id, $stockEntry->amount, $stockEntry->location_id, $locationIdTo, $stockEntry->stock_id, $transactionId); } } }