mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-13 02:38:34 +01:00
Allow to pass infos from barcodes to creation dialog
This commit is contained in:
@@ -290,6 +290,20 @@ final class PartController extends AbstractController
|
||||
$this->addFlash('warning', t("part.create_from_info_provider.no_category_yet"));
|
||||
}
|
||||
|
||||
$lotAmount = $request->query->get('lotAmount');
|
||||
$lotName = $request->query->get('lotName');
|
||||
$lotUserBarcode = $request->query->get('lotUserBarcode');
|
||||
|
||||
if ($lotAmount !== null || $lotName !== null || $lotUserBarcode !== null) {
|
||||
$partLot = new PartLot();
|
||||
$partLot->setAmount($lotAmount !== null ? (float)$lotAmount : 0);
|
||||
$partLot->setDescription($lotName !== null ? (string)$lotName : '');
|
||||
$partLot->setUserBarcode($lotUserBarcode !== null ? (string)$lotUserBarcode : '');
|
||||
|
||||
$new_part->addPartLot($partLot);
|
||||
}
|
||||
|
||||
|
||||
return $this->renderPartForm('new', $request, $new_part, [
|
||||
'info_provider_dto' => $dto,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user