From 0f6dae313df955d8aa1ca3e11468338a0b271a7e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 30 Mar 2021 23:02:53 +0200 Subject: [PATCH 1/2] fix : test on reception must be done on lineToTest if checked --- htdocs/reception/card.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 3bac7265606..7bfbff09ecb 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -318,9 +318,15 @@ if (empty($reshook)) $entrepot_id = is_numeric(GETPOST($ent, 'int')) ? GETPOST($ent, 'int') : GETPOST('entrepot_id', 'int'); + if (!empty($lineToTest)) { + $fk_product = $lineToTest->fk_product; + } else { + $fk_product = $linesrc->fk_product; + } + if ($entrepot_id < 0) $entrepot_id = ''; - if (!($linesrc->fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES)) + if (!($fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES)) $entrepot_id = 0; $eatby = GETPOST($eatby, 'alpha'); $sellby = GETPOST($sellby, 'alpha'); From cd37d3440a38ea7211365a33503e8a9b6d7d2ec3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 30 Mar 2021 23:04:29 +0200 Subject: [PATCH 2/2] fix : test on reception must be done on lineToTest if checked --- htdocs/reception/card.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 7bfbff09ecb..66aa1b300b8 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -237,8 +237,6 @@ if (empty($reshook)) $objectsrc = new $classname($db); $objectsrc->fetch($object->origin_id); - - $object->socid = $objectsrc->socid; $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); $object->model_pdf = GETPOST('model'); @@ -280,10 +278,8 @@ if (empty($reshook)) $stockLocation = "ent1".$i."_0"; $qty = "qtyl".$i; - - - //var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit; - //reception line for product with no batch management and no multiple stock location + //var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit; + //reception line for product with no batch management and no multiple stock location if (GETPOST($qty, 'int') > 0) $totalqty += GETPOST($qty, 'int');