Fix plant code validation logic in UserImporter

This commit is contained in:
dhanabalan
2025-09-29 12:28:18 +05:30
parent af3ce0ea40
commit 168e9266fe

View File

@@ -56,7 +56,7 @@ class UserImporter extends Importer
$warnMsg = []; $warnMsg = [];
$plant = null; $plant = null;
if (Str::length($this->data['plant']) > 0) { if (Str::length($this->data['plant']) > 0) {
if (Str::length($this->data['plant']) < 4 || !is_numeric($this->data['plant'] || !preg_match('/^[1-9]\d{3,}$/', $this->data['plant']))) { if (Str::length($this->data['plant']) < 4 || !is_numeric($this->data['plant']) || !preg_match('/^[1-9]\d{3,}$/', $this->data['plant'])) {
$warnMsg[] = "Invalid plant code found!"; $warnMsg[] = "Invalid plant code found!";
} }
else { else {