From 32c5e7bec61dbc949ce9db09d42a5a8d25cdc073 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 6 Jun 2026 18:21:25 +0530 Subject: [PATCH] Updated isi_model column value validation logic --- app/Filament/Imports/MotorTestingMasterImporter.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/Filament/Imports/MotorTestingMasterImporter.php b/app/Filament/Imports/MotorTestingMasterImporter.php index ed5dbe4..ee0d296 100644 --- a/app/Filament/Imports/MotorTestingMasterImporter.php +++ b/app/Filament/Imports/MotorTestingMasterImporter.php @@ -237,7 +237,7 @@ class MotorTestingMasterImporter extends Importer $plantCod = trim($this->data['plant']); $iCode = trim($this->data['item']); $sCode = trim($this->data['subassembly_code']); - $isiModel = (trim($this->data['isi_model']) == '1') ? true : false; + $isiModel = trim($this->data['isi_model']); $phase = trim($this->data['phase']); $kw = trim($this->data['kw']); $hp = trim($this->data['hp']); @@ -289,13 +289,8 @@ class MotorTestingMasterImporter extends Importer } elseif (! $iCode) { $warnMsg[] = 'Item code not found for choosed plant'; } else { - // if (Str::length($isiModel) <= 0 || $isiModel == "0" || $isiModel == "1") { - // $warnMsg[] = "Invalid ISI Model found"; - // } - // else - // { - // $isiModel = ($isiModel == "1"); - // } + $isiModel = (Str::length($isiModel) == 1 && ctype_alnum($isiModel) && ($isiModel == '1' || $isiModel == 'Y' || $isiModel == 'y')) ? true : false; + if (Str::length($phase) <= 0 || ($phase != 'Single' && $phase != 'Three')) {// !is_string($phase) || $warnMsg[] = 'Invalid phase found'; }