From 7a8c35baa75a8ff92cc7949f064ef697b4f53ff8 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sat, 26 Nov 2022 01:33:11 +0100 Subject: [PATCH] FIX Negative consumption in MO creates additional goods issue #21343 --- htdocs/mrp/mo_production.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 64ae11909ef..7bff43bfc7b 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -220,7 +220,7 @@ if (empty($reshook)) { if ($qtytoprocess >= 0) { $idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); } else { - $idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); + $idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess * -1, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); } if ($idstockmove < 0) { $error++;