Skip to content

Commit 3480dd1

Browse files
committed
Do not use customer reference for digikey barcode creation info as it likely contains not the part number
Fixes #1285
1 parent dbe49b5 commit 3480dd1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Services/LabelSystem/BarcodeScanner/BarcodeScanResultHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,19 +304,19 @@ private function getCreationInfoForEIGP114(EIGP114BarcodeScanResult $scanResult)
304304
return null;
305305
}
306306

307-
// Digi-Key: can use customerPartNumber or supplierPartNumber directly
307+
// Digi-Key: supplierPartNumber directly
308308
if ($vendor === 'digikey') {
309309
return [
310310
'providerKey' => 'digikey',
311-
'providerId' => $scanResult->customerPartNumber ?? $scanResult->supplierPartNumber,
311+
'providerId' => $scanResult->supplierPartNumber ?? throw new \RuntimeException('Digikey barcode does not contain required supplier part number'),
312312
];
313313
}
314314

315315
// Element14: can use supplierPartNumber directly
316316
if ($vendor === 'element14') {
317317
return [
318318
'providerKey' => 'element14',
319-
'providerId' => $scanResult->supplierPartNumber,
319+
'providerId' => $scanResult->supplierPartNumber ?? throw new \RuntimeException('Element14 barcode does not contain required supplier part number'),
320320
];
321321
}
322322

0 commit comments

Comments
 (0)