Allow to pass infos from barcodes to creation dialog

This commit is contained in:
Jan Böhmer
2026-03-07 21:48:27 +01:00
parent a722608ae8
commit 70919d953a
3 changed files with 47 additions and 20 deletions

View File

@@ -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,
]);