From e1de510c389396730d4aef03ccecd780b226f3c3 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Mon, 31 May 2021 11:06:52 +0200 Subject: [PATCH] Do a strict comparison when check if stock is enough --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 2429a4c09c5..ec2dfbc257e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -355,7 +355,7 @@ class MouvementStock extends CommonObject $qtyisnotenough = 0; foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) { - if ($batch != $batchcursor) continue; + if ($batch !== $batchcursor) continue; // Do a strict comparison because $batchcursar can be an integer $foundforbatch = 1; if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty; break;