Merge pull request #17778 from tuxgasy/fix_check_stock_with_batch
Fix: Do a strict comparison when check if stock is enough
This commit is contained in:
commit
7608f0b383
@ -355,7 +355,9 @@ class MouvementStock extends CommonObject
|
|||||||
$qtyisnotenough = 0;
|
$qtyisnotenough = 0;
|
||||||
foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch)
|
foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch)
|
||||||
{
|
{
|
||||||
if ($batch != $batchcursor) continue;
|
if ((string) $batch != (string) $batchcursor) { // Lot '59' must be different than lot '59c'
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$foundforbatch = 1;
|
$foundforbatch = 1;
|
||||||
if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty;
|
if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user