Added serila number length check validation in panel box validation page #1040

Merged
jothi merged 1 commits from ranjith-dev into master 2026-09-17 10:32:02 +00:00

View File

@@ -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){