diff --git a/src/DataFixtures/PartFixtures.php b/src/DataFixtures/PartFixtures.php index a9290cbf..0c8ea36d 100644 --- a/src/DataFixtures/PartFixtures.php +++ b/src/DataFixtures/PartFixtures.php @@ -106,7 +106,7 @@ class PartFixtures extends Fixture implements DependentFixtureInterface $partLot2->setComment('Test'); $partLot2->setNeedsRefill(true); $partLot2->setStorageLocation($manager->find(StorageLocation::class, 3)); - $partLot2->setVendorBarcode('lot2_vendor_barcode'); + $partLot2->setUserBarcode('lot2_vendor_barcode'); $part->addPartLot($partLot2); $orderdetail = new Orderdetail(); diff --git a/src/Entity/Parts/PartLot.php b/src/Entity/Parts/PartLot.php index c1b7da8a..d893e6de 100644 --- a/src/Entity/Parts/PartLot.php +++ b/src/Entity/Parts/PartLot.php @@ -68,7 +68,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; #[ORM\Index(columns: ['needs_refill'], name: 'part_lots_idx_needs_refill')] #[ORM\Index(columns: ['vendor_barcode'], name: 'part_lots_idx_barcode')] #[ValidPartLot] -#[UniqueEntity(['vendor_barcode'], message: 'validator.part_lot.vendor_barcode_must_be_unique')] +#[UniqueEntity(['user_barcode'], message: 'validator.part_lot.vendor_barcode_must_be_unique')] #[ApiResource( operations: [ new Get(security: 'is_granted("read", object)'), @@ -166,10 +166,10 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named /** * @var string|null The content of the barcode of this part lot (e.g. a barcode on the package put by the vendor) */ - #[ORM\Column(type: Types::STRING, nullable: true)] + #[ORM\Column(name: "vendor_barcode", type: Types::STRING, nullable: true)] #[Groups(['part_lot:read', 'part_lot:write'])] #[Length(max: 255)] - protected ?string $vendor_barcode = null; + protected ?string $user_barcode = null; public function __clone() { @@ -375,19 +375,19 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named * null if no barcode is set. * @return string|null */ - public function getVendorBarcode(): ?string + public function getUserBarcode(): ?string { - return $this->vendor_barcode; + return $this->user_barcode; } /** * Set the content of the barcode of this part lot (e.g. a barcode on the package put by the vendor). - * @param string|null $vendor_barcode + * @param string|null $user_barcode * @return $this */ - public function setVendorBarcode(?string $vendor_barcode): PartLot + public function setUserBarcode(?string $user_barcode): PartLot { - $this->vendor_barcode = $vendor_barcode; + $this->user_barcode = $user_barcode; return $this; } diff --git a/src/Form/LabelSystem/ScanDialogType.php b/src/Form/LabelSystem/ScanDialogType.php index 729e2566..4723bbf9 100644 --- a/src/Form/LabelSystem/ScanDialogType.php +++ b/src/Form/LabelSystem/ScanDialogType.php @@ -71,8 +71,8 @@ class ScanDialogType extends AbstractType null => 'scan_dialog.mode.auto', BarcodeSourceType::INTERNAL => 'scan_dialog.mode.internal', BarcodeSourceType::IPN => 'scan_dialog.mode.ipn', - BarcodeSourceType::USER_DEFINED => 'scan_dialog.mode.vendor', - BarcodeSourceType::VENDOR => 'Interpret vendor (digikey for now)' //TODO:translate + BarcodeSourceType::USER_DEFINED => 'scan_dialog.mode.user', + BarcodeSourceType::VENDOR => 'scan_dialog.mode.eigp' }, ]); diff --git a/src/Form/Part/PartLotType.php b/src/Form/Part/PartLotType.php index da061c7f..785810a6 100644 --- a/src/Form/Part/PartLotType.php +++ b/src/Form/Part/PartLotType.php @@ -103,8 +103,8 @@ class PartLotType extends AbstractType 'help' => 'part_lot.owner.help', ]); - $builder->add('vendor_barcode', TextType::class, [ - 'label' => 'part_lot.edit.vendor_barcode', + $builder->add('user_barcode', TextType::class, [ + 'label' => 'part_lot.edit.user_barcode', 'help' => 'part_lot.edit.vendor_barcode.help', 'required' => false, ]); diff --git a/src/Services/LabelSystem/Barcodes/BarcodeScanHelper.php b/src/Services/LabelSystem/Barcodes/BarcodeScanHelper.php index 62c1f798..6dbd3219 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeScanHelper.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeScanHelper.php @@ -220,7 +220,7 @@ final class BarcodeScanHelper { $lot_repo = $this->entityManager->getRepository(PartLot::class); //Find only the first result - $results = $lot_repo->findBy(['vendor_barcode' => $input], limit: 1); + $results = $lot_repo->findBy(['user_barcode' => $input], limit: 1); if (count($results) === 0) { return null; diff --git a/src/Services/LabelSystem/Barcodes/BarcodeSourceType.php b/src/Services/LabelSystem/Barcodes/BarcodeSourceType.php index 18d4ddb9..06ff0bea 100644 --- a/src/Services/LabelSystem/Barcodes/BarcodeSourceType.php +++ b/src/Services/LabelSystem/Barcodes/BarcodeSourceType.php @@ -32,9 +32,9 @@ enum BarcodeSourceType case INTERNAL; /** This barcode is containing an internal part number (IPN) */ case IPN; + /** - * This barcode is a custom barcode from a third party like a vendor, which was set via the vendor_barcode - * field of a part lot. + * This barcode is a user defined barcode defined on a part lot */ case USER_DEFINED; diff --git a/templates/parts/edit/edit_form_styles.html.twig b/templates/parts/edit/edit_form_styles.html.twig index 6658fa80..cf9a40b9 100644 --- a/templates/parts/edit/edit_form_styles.html.twig +++ b/templates/parts/edit/edit_form_styles.html.twig @@ -108,7 +108,7 @@