diff --git a/app/Filament/Pages/PanelBoxInspectionStock.php b/app/Filament/Pages/PanelBoxInspectionStock.php index eb9130f..9f87d84 100644 --- a/app/Filament/Pages/PanelBoxInspectionStock.php +++ b/app/Filament/Pages/PanelBoxInspectionStock.php @@ -310,6 +310,22 @@ class PanelBoxInspectionStock extends Page $itemCode = $panelBoxCode; $serialNumber = $panelBoxSerialNo; + if (strlen($serialNumber) > 28) { + Notification::make() + ->title('Invalid Serial Number') + ->body("Serial number cannot be greater than 28 characters. Current length: " . strlen($panelBoxSerialNo)) + ->danger() + ->send(); + + $this->form->fill([ + 'plant_id' => $plantId, + 'line_id' => $lineId, + 'item_id' => null, + ]); + + return; + } + $iId = Item::where('code', $itemCode)->where('plant_id', $plantId)->first(); if(!$iId){