From ef6443b68ac65aa97944d18047cdb0186b4e99e2 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 29 May 2026 15:28:23 +0530 Subject: [PATCH 1/6] Added searchable() function on select controls --- app/Filament/Resources/MachineResource.php | 4 ++++ app/Filament/Resources/WorkGroupMasterResource.php | 1 + 2 files changed, 5 insertions(+) diff --git a/app/Filament/Resources/MachineResource.php b/app/Filament/Resources/MachineResource.php index dd2cbab..06cd34c 100644 --- a/app/Filament/Resources/MachineResource.php +++ b/app/Filament/Resources/MachineResource.php @@ -43,6 +43,7 @@ class MachineResource extends Resource Forms\Components\Select::make('plant_id') ->label('Plant Name') ->relationship('plant', 'name') + ->searchable() ->required() ->columnSpan(1) ->reactive() @@ -75,6 +76,7 @@ class MachineResource extends Resource Forms\Components\Select::make('line_id') ->label('Line Name') ->relationship('line', 'name') + ->searchable() ->required() ->columnSpan(1) ->reactive() @@ -115,6 +117,7 @@ class MachineResource extends Resource Forms\Components\Select::make('work_group_master_id') ->label('Group Work Center') ->relationship('workGroupMaster', 'name') + ->searchable() ->required() ->columnSpan(1) ->reactive() @@ -142,6 +145,7 @@ class MachineResource extends Resource $lineId = $get('line_id'); if (! $lineId) { $set('mGroupWorkError', 'Please select a line first.'); + $set('work_group_master_id', null); return; } else { diff --git a/app/Filament/Resources/WorkGroupMasterResource.php b/app/Filament/Resources/WorkGroupMasterResource.php index eaecff0..36d58ef 100644 --- a/app/Filament/Resources/WorkGroupMasterResource.php +++ b/app/Filament/Resources/WorkGroupMasterResource.php @@ -40,6 +40,7 @@ class WorkGroupMasterResource extends Resource Forms\Components\Select::make('plant_id') ->label('Plant Name') ->relationship('plant', 'name') + ->searchable() ->reactive() ->columnSpan(1) ->required() From 58629f4cbb7ed0ed5e2339fbf6249b01bbc870ba Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 29 May 2026 15:32:50 +0530 Subject: [PATCH 2/6] Removed unwanted set property --- app/Filament/Resources/WorkGroupMasterResource.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Filament/Resources/WorkGroupMasterResource.php b/app/Filament/Resources/WorkGroupMasterResource.php index 36d58ef..fe8db2c 100644 --- a/app/Filament/Resources/WorkGroupMasterResource.php +++ b/app/Filament/Resources/WorkGroupMasterResource.php @@ -65,7 +65,6 @@ class WorkGroupMasterResource extends Resource return; } - $set('validationError', null); $set('pqPlantError', null); $set('name', null); $set('description', null); From 29b4775af213ff754c92394078de90ab9a102d86 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 29 May 2026 15:35:05 +0530 Subject: [PATCH 3/6] Simplified code logic on set property null while plant change --- app/Filament/Resources/WorkGroupMasterResource.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/Filament/Resources/WorkGroupMasterResource.php b/app/Filament/Resources/WorkGroupMasterResource.php index fe8db2c..b1d7f2c 100644 --- a/app/Filament/Resources/WorkGroupMasterResource.php +++ b/app/Filament/Resources/WorkGroupMasterResource.php @@ -56,19 +56,15 @@ class WorkGroupMasterResource extends Resource ->afterStateUpdated(function ($state, $set, callable $get) { $plantId = $get('plant_id'); - if (! $plantId) { - $set('pqPlantError', 'Please select a plant first.'); - $set('name', null); - $set('description', null); - $set('operation_number', null); - - return; - } - $set('pqPlantError', null); $set('name', null); $set('description', null); $set('operation_number', null); + if (! $plantId) { + $set('pqPlantError', 'Please select a plant first.'); + + return; + } }) ->hint(fn ($get) => $get('pqPlantError') ? $get('pqPlantError') : null) ->hintColor('danger'), From e27326258e0a2c7ebffbb31c2cfddd926ebcee8c Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 29 May 2026 15:37:17 +0530 Subject: [PATCH 4/6] Modified logic for adjustment of 2 rows of items in wire pallet pdf --- resources/views/pdf/wire-pallet.blade.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/resources/views/pdf/wire-pallet.blade.php b/resources/views/pdf/wire-pallet.blade.php index 5112374..39f7bd1 100644 --- a/resources/views/pdf/wire-pallet.blade.php +++ b/resources/views/pdf/wire-pallet.blade.php @@ -12,10 +12,10 @@ $headerRows = [ 'PRODUCT' => $product, - 'MONTH/YEAR' => $monthYear, + 'MFG. MONTH & YEAR' => $monthYear, 'CUSTOMER PO' => $customerCode, 'CUSTOMER NAME' => $customerName, - 'NO OF MASTER BOX' => $masterBox, + 'MASTER BOX NO.' => $masterBox, ]; $titleHeight = 10; @@ -55,6 +55,9 @@ if ($numItems == 1) { $itemRowHeight -= 0.5; } + if ($numItems == 2) { + $itemRowHeight += 0.4; + } if ($itemRowHeight < 3) { $itemFontSize = '5.5px'; @@ -290,7 +293,7 @@ style="height: mm; max-width: mm; width: auto;"> - C.R.I POLY WRAPPED WINDING WIRE + C.R.I. POLY WRAPPED WINDING WIRE
{{-- MATERIAL CODE DESCRIPTION - QTY - NO OF BOX + QTY in kg + NO. OF BOXES @@ -342,13 +345,13 @@ - GROSS WEIGHT + GROSS WEIGHT(kg) - NET WEIGHT + NET WEIGHT(kg) @@ -368,8 +371,8 @@ C.R.I. PUMPS PRIVATE LIMITED
(Unit of {{ $plantName }})
{{ $plantAddress }}
- India Regd.Office : 7/46-1, Keeranatham Road, Saravanampatti, Coimbatore-641 036
- For Feedback/Complaint: C.R.I Customer care cell Toll-Free: 1800 121 1243 + India Regd.Office : 7/46-1, Keeranatham Road, Saravanampatti, Coimbatore- 641 035
+ For Feedback/Complaint: C.R.I. Customer care cell Toll-Free: 1800 121 1243 {{-- --}} From 8c362bd83f6fadfb9d3513ae07cd9575714d86ed Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 29 May 2026 15:39:51 +0530 Subject: [PATCH 5/6] Updated error logic on plant change --- app/Filament/Resources/WorkGroupMasterResource.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Filament/Resources/WorkGroupMasterResource.php b/app/Filament/Resources/WorkGroupMasterResource.php index b1d7f2c..8b21ab2 100644 --- a/app/Filament/Resources/WorkGroupMasterResource.php +++ b/app/Filament/Resources/WorkGroupMasterResource.php @@ -56,17 +56,20 @@ class WorkGroupMasterResource extends Resource ->afterStateUpdated(function ($state, $set, callable $get) { $plantId = $get('plant_id'); - $set('pqPlantError', null); + $set('wgmPlantError', null); $set('name', null); $set('description', null); $set('operation_number', null); if (! $plantId) { - $set('pqPlantError', 'Please select a plant first.'); + $set('wgmPlantError', 'Please select a plant first.'); return; } }) - ->hint(fn ($get) => $get('pqPlantError') ? $get('pqPlantError') : null) + ->extraAttributes(fn ($get) => [ + 'class' => $get('wgmPlantError') ? 'border-red-500' : '', + ]) + ->hint(fn ($get) => $get('wgmPlantError') ? $get('wgmPlantError') : null) ->hintColor('danger'), Forms\Components\TextInput::make('name') ->label('Group Work Center') From 280b62d27d910b6aa2ae024661a2015a292553d4 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 29 May 2026 15:47:33 +0530 Subject: [PATCH 6/6] Added logic for checking wthehere same customer name or not --- .../Imports/CustomerPoMasterImporter.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/Filament/Imports/CustomerPoMasterImporter.php b/app/Filament/Imports/CustomerPoMasterImporter.php index 430f81b..bf089bf 100644 --- a/app/Filament/Imports/CustomerPoMasterImporter.php +++ b/app/Filament/Imports/CustomerPoMasterImporter.php @@ -17,6 +17,8 @@ class CustomerPoMasterImporter extends Importer { protected static ?string $model = CustomerPoMaster::class; + protected array $importedPos = []; + public static function getColumns(): array { return [ @@ -67,6 +69,8 @@ class CustomerPoMasterImporter extends Importer $plantCod = $this->data['plant']; $plant = null; $item = null; + $customerPo = trim($this->data['customer_po']); + $customerName = trim($this->data['customer_name']); if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) { $warnMsg[] = 'Invalid plant code found'; @@ -90,6 +94,23 @@ class CustomerPoMasterImporter extends Importer $warnMsg[] = 'Customer PO cannot be empty.'; } + if (isset($this->importedPos[$customerPo])) { + + if (strtolower(trim($this->importedPos[$customerPo])) != strtolower($customerName)){ + $warnMsg[] = "Customer PO '{$customerPo}' has multiple customer names in the import file."; + } + } + else { + $this->importedPos[$customerPo] = $customerName; + } + + $existingPo = CustomerPoMaster::where('plant_id', $plant->id)->where('customer_po', $this->data['customer_po'])->first(); + + if ($existingPo && trim(strtolower($existingPo->customer_name)) != trim(strtolower($this->data['customer_name']))) + { + $warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already mapped to customer '{$existingPo->customer_name}'."; + } + // $user = User::where('name', $this->data['created_by'])->first(); // if (! $user) { // $warnMsg[] = 'User not found';