From 6e61f83e3a9d90e9eba15d403b08a4bc2af8e259 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 5 Aug 2025 12:03:49 +0530 Subject: [PATCH] Validate production order length to be between 7 and 14 digits in both ProductionQuantityImporter and QualityValidationImporter --- app/Filament/Imports/ProductionQuantityImporter.php | 2 +- app/Filament/Imports/QualityValidationImporter.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Filament/Imports/ProductionQuantityImporter.php b/app/Filament/Imports/ProductionQuantityImporter.php index c8f637b..749363b 100644 --- a/app/Filament/Imports/ProductionQuantityImporter.php +++ b/app/Filament/Imports/ProductionQuantityImporter.php @@ -130,7 +130,7 @@ class ProductionQuantityImporter extends Importer if (Str::length($this->data['serial_number']) < 9 || !ctype_alnum($this->data['serial_number'])) { $warnMsg[] = "Invalid serial number found"; } - if (Str::length($this->data['production_order']) > 0 && (Str::length($this->data['production_order']) < 7 || !is_numeric($this->data['production_order']))) { + if (Str::length($this->data['production_order']) > 0 && (Str::length($this->data['production_order']) < 7 || Str::length($this->data['production_order']) > 14 || !is_numeric($this->data['production_order']))) { $warnMsg[] = "Invalid production order found"; } diff --git a/app/Filament/Imports/QualityValidationImporter.php b/app/Filament/Imports/QualityValidationImporter.php index 9a2c642..64dc019 100644 --- a/app/Filament/Imports/QualityValidationImporter.php +++ b/app/Filament/Imports/QualityValidationImporter.php @@ -206,7 +206,7 @@ class QualityValidationImporter extends Importer $warnMsg[] = "Sticker item code not found"; } - if (!is_numeric($this->data['production_order']) || Str::length($this->data['production_order']) < 7) { + if (!is_numeric($this->data['production_order']) || Str::length($this->data['production_order']) < 7 || Str::length($this->data['production_order']) > 14) { $warnMsg[] = "Invalid production order found"; }