Merge pull request #18510 from henrynopo/patch-9

Fix - edit shipment Qty both predefined product while batch and stock are not enabled
This commit is contained in:
Laurent Destailleur 2021-08-28 16:36:05 +02:00 committed by GitHub
commit 4c39816ce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -717,6 +717,16 @@ if (empty($reshook)) {
unset($_POST[$qty]);
}
}
} elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
$qty = "qtyl".$line_id;
$line->id = $line_id;
$line->qty = GETPOST($qty, 'int');
$line->entrepot_id = 0;
if ($line->update($user) < 0) {
setEventMessages($line->error, $line->errors, 'errors');
$error++;
}
unset($_POST[$qty]);
}
} else {
// Product no predefined
@ -2252,6 +2262,16 @@ if ($action == 'create') {
print '<td></td>';
print '</tr>';
}
} elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
print '<!-- case edit 6 -->';
print '<tr>';
// Qty to ship or shipped
print '<td><input class="qtyl" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'"></td>';
// Warehouse source
print '<td></td>';
// Batch number managment
print '<td></td>';
print '</tr>';
}
print '</table></td>';