removed required for work_center in test certificate page #1435

Merged
jothi merged 1 commits from ranjith-dev into master 2026-11-17 03:49:36 +00:00
Showing only changes of commit 24e6d4069d - Show all commits

View File

@@ -86,8 +86,7 @@ class TestCertificate extends Page implements HasForms
return Machine::where('plant_id', $plantId)
->pluck('work_center', 'id')
->toArray();
})
->required(),
}),
TextInput::make('production_order')
->label('Production Order')
->reactive()
@@ -501,7 +500,6 @@ class TestCertificate extends Page implements HasForms
$prodOrderNo = trim($prodOrderNo) ?? null;
if (!$qrcode || !preg_match('/^\d+\|\d+$/', $qrcode)) {
Notification::make()
->title('Invalid QR Code')
@@ -1633,10 +1631,14 @@ class TestCertificate extends Page implements HasForms
$mappedMachineId = trim((string) $matchedMachineId);
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()
->danger()
->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();
return;