Updated plant code length should be 4 to 7
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled

This commit is contained in:
dhanabalan
2026-04-30 15:44:39 +05:30
parent 04cbf548de
commit 4de8a306ea
5 changed files with 13 additions and 7 deletions

View File

@@ -66,7 +66,7 @@ class PlantImporter extends Importer
$warnMsg[] = 'Code should contain only numeric values!';
} elseif (Str::length($code) < 4 || Str::length($code) > 7) {
$warnMsg[] = 'Code must be between 4 and 7 digits only!';
} elseif (! preg_match('/^[1-9]\d{6,}$/', $code)) {
} elseif (! preg_match('/^[1-9]\d{3,6}$/', $code)) {
$warnMsg[] = 'Invalid plant code found!';
}
if ($name == null || $name == '' || ! $name) {

View File

@@ -127,7 +127,7 @@ class ProcessOrderImporter extends Importer
if ($plantCod == null || $plantCod == '') {
$warnMsg[] = "Plant code can't be empty!";
} elseif (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
} elseif (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,6}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
}
if ($iCode == null || $iCode == '') {

View File

@@ -100,7 +100,7 @@ class ProductionOrderImporter extends Importer
$warnMsg[] = 'Plant code should contain only numeric values!';
} elseif (Str::length($plantCod) < 4 || Str::length($plantCod) > 7) {
$warnMsg[] = 'Plant code must be between 4 and 7 digits only!';
} elseif (! preg_match('/^[1-9]\d{6,}$/', $plantCod)) {
} elseif (! preg_match('/^[1-9]\d{3,6}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found!';
}

View File

@@ -182,8 +182,14 @@ class StickerMasterImporter extends Importer
$createdBy = Filament::auth()->user()->name;
$updatedBy = Filament::auth()->user()->name;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
if ($plantCod == null || $plantCod == '') {
$warnMsg[] = "Plant code can't be empty!";
} elseif (! is_numeric($plantCod)) {
$warnMsg[] = 'Plant code should contain only numeric values!';
} elseif (Str::length($plantCod) < 4 || Str::length($plantCod) > 7) {
$warnMsg[] = 'Plant code must be between 4 and 7 digits only!';
} elseif (! preg_match('/^[1-9]\d{3,6}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found!';
} else {
$plant = Plant::where('code', $plantCod)->first();
}