Merge pull request #16949 from artis-auxilium/fix_13024

Fix #13024 wrong line is used for reception
This commit is contained in:
Laurent Destailleur
2021-03-25 00:33:13 +01:00
committed by GitHub

View File

@@ -317,11 +317,16 @@ if (empty($reshook)) {
//var_dump($_POST);exit;
for ($i = 1; $i <= $num; $i++) {
$lineToTest = '';
$lineId = GETPOST($idl, 'int');
foreach ($objectsrc->lines as $linesrc) {
if ($linesrc->id == GETPOST($idl, 'int')) {
if ($linesrc->id == $lineId) {
$lineToTest = $linesrc;
break;
}
}
if (empty($lineToTest)) {
continue;
}
$qty = "qtyl".$i;
$comment = "comment".$i;
$eatby = "dlc".$i;
@@ -340,7 +345,7 @@ if (empty($reshook)) {
if ($entrepot_id < 0) {
$entrepot_id = '';
}
if (!($linesrc->fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!($lineToTest->fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
$entrepot_id = 0;
}
$eatby = GETPOST($eatby, 'alpha');