removed required for work_center in test certificate page #1435
@@ -86,8 +86,7 @@ class TestCertificate extends Page implements HasForms
|
|||||||
return Machine::where('plant_id', $plantId)
|
return Machine::where('plant_id', $plantId)
|
||||||
->pluck('work_center', 'id')
|
->pluck('work_center', 'id')
|
||||||
->toArray();
|
->toArray();
|
||||||
})
|
}),
|
||||||
->required(),
|
|
||||||
TextInput::make('production_order')
|
TextInput::make('production_order')
|
||||||
->label('Production Order')
|
->label('Production Order')
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -501,7 +500,6 @@ class TestCertificate extends Page implements HasForms
|
|||||||
|
|
||||||
$prodOrderNo = trim($prodOrderNo) ?? null;
|
$prodOrderNo = trim($prodOrderNo) ?? null;
|
||||||
|
|
||||||
|
|
||||||
if (!$qrcode || !preg_match('/^\d+\|\d+$/', $qrcode)) {
|
if (!$qrcode || !preg_match('/^\d+\|\d+$/', $qrcode)) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Invalid QR Code')
|
->title('Invalid QR Code')
|
||||||
@@ -1633,10 +1631,14 @@ class TestCertificate extends Page implements HasForms
|
|||||||
$mappedMachineId = trim((string) $matchedMachineId);
|
$mappedMachineId = trim((string) $matchedMachineId);
|
||||||
|
|
||||||
if ($mappedMachineId === '' || $mappedMachineId !== $selectedMachineId) {
|
if ($mappedMachineId === '' || $mappedMachineId !== $selectedMachineId) {
|
||||||
|
$Mname1 = Machine::where('id', $selectedMachineId)->first();
|
||||||
|
$workC1 = $Mname1->work_center ?? null;
|
||||||
|
$Mname2 = Machine::where('id', $mappedMachineId)->first();
|
||||||
|
$workC2 = $Mname2->work_center ?? null;
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->danger()
|
->danger()
|
||||||
->title('Machine Mapping Mismatch')
|
->title('Machine Mapping Mismatch')
|
||||||
->body("Selected machine '{$selectedMachineId}' does not match the mapped machine '{$mappedMachineId}'.")
|
->body("Selected machine '{$workC1}' does not match the mapped machine '{$workC2}'.")
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user