Merge pull request 'Updated item code validation logic to allow alpha numeric' (#1482) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 38s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 38s
Reviewed-on: #1482
This commit was merged in pull request #1482.
This commit is contained in:
@@ -17,7 +17,6 @@ use Filament\Actions\Imports\Importer;
|
|||||||
use Filament\Actions\Imports\Models\Import;
|
use Filament\Actions\Imports\Models\Import;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Str;
|
use Str;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class ProductionPlanImporter extends Importer
|
class ProductionPlanImporter extends Importer
|
||||||
{
|
{
|
||||||
@@ -138,7 +137,7 @@ class ProductionPlanImporter extends Importer
|
|||||||
$warnMsg[] = 'Plant not found';
|
$warnMsg[] = 'Plant not found';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Str::length($itemCod) < 6 || ! is_numeric($itemCod)) {
|
if (Str::length($itemCod) < 6 || ! ctype_alnum($itemCod)) {
|
||||||
$warnMsg[] = 'Invalid item code found';
|
$warnMsg[] = 'Invalid item code found';
|
||||||
} else {
|
} else {
|
||||||
$item = Item::where('code', $itemCod)->first();
|
$item = Item::where('code', $itemCod)->first();
|
||||||
@@ -154,8 +153,7 @@ class ProductionPlanImporter extends Importer
|
|||||||
|
|
||||||
if (! $itemAgaPlant) {
|
if (! $itemAgaPlant) {
|
||||||
$warnMsg[] = 'Item not found against plant code';
|
$warnMsg[] = 'Item not found against plant code';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$line = $itemAgaPlant->line_id;
|
$line = $itemAgaPlant->line_id;
|
||||||
|
|
||||||
if (! $line) {
|
if (! $line) {
|
||||||
@@ -207,7 +205,6 @@ class ProductionPlanImporter extends Importer
|
|||||||
throw new RowImportFailedException(implode(', ', $warnMsg));
|
throw new RowImportFailedException(implode(', ', $warnMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$recordDate = now();
|
$recordDate = now();
|
||||||
$month = $recordDate->month;
|
$month = $recordDate->month;
|
||||||
$year = $recordDate->year;
|
$year = $recordDate->year;
|
||||||
@@ -346,9 +343,6 @@ class ProductionPlanImporter extends Importer
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ..Working Logic
|
// ..Working Logic
|
||||||
|
|
||||||
// $recordDate = now();
|
// $recordDate = now();
|
||||||
|
|||||||
Reference in New Issue
Block a user