Update mouvementstock.class.php

This commit is contained in:
Laurent Destailleur 2021-06-04 10:33:13 +02:00 committed by GitHub
parent e1de510c38
commit 174c6f8a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -355,7 +355,9 @@ class MouvementStock extends CommonObject
$qtyisnotenough = 0;
foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch)
{
if ($batch !== $batchcursor) continue; // Do a strict comparison because $batchcursar can be an integer
if ((string) $batch != (string) $batchcursor) { // Lot '59' must be different than lot '59c'
continue;
}
$foundforbatch = 1;
if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty;
break;