diff --git a/app/Filament/Resources/PanelBoxValidationResource.php b/app/Filament/Resources/PanelBoxValidationResource.php index ad3c4fa..05d5ed5 100644 --- a/app/Filament/Resources/PanelBoxValidationResource.php +++ b/app/Filament/Resources/PanelBoxValidationResource.php @@ -38,7 +38,7 @@ class PanelBoxValidationResource extends Resource { protected static ?string $model = PanelBoxValidation::class; - protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; + protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-check'; protected static ?string $navigationGroup = 'Panel Box'; @@ -581,6 +581,19 @@ class PanelBoxValidationResource extends Resource $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(); + + $set('item_id', null); + $set('serial_exists', false); + + return; + } + $existInMasterPo = PanelGrMaster::where('document_number', $pOrder)->where('plant_id', $plantId)->first(); if(!$existInMasterPo){