From 688674aa40d6ecdb8d796477c7a466560dc2eeb5 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 6 Jun 2026 19:49:44 +0530 Subject: [PATCH 1/2] Added label, placeholder, default value and subassembly_code filter logic --- .../Resources/MotorTestingMasterResource.php | 72 ++++++++++++++++--- 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/app/Filament/Resources/MotorTestingMasterResource.php b/app/Filament/Resources/MotorTestingMasterResource.php index 8c4521b..2b6b0c1 100644 --- a/app/Filament/Resources/MotorTestingMasterResource.php +++ b/app/Filament/Resources/MotorTestingMasterResource.php @@ -119,7 +119,7 @@ class MotorTestingMasterResource extends Resource Forms\Components\TextInput::make('subassembly_code') ->label('Subassembly Code') // ->required() - ->placeholder('Scan the valid code') + ->placeholder('Scan the subassembly code') ->reactive() ->alphaNum() ->minLength(6) @@ -195,42 +195,49 @@ class MotorTestingMasterResource extends Resource ->reactive(), Forms\Components\TextInput::make('hp') ->label('HP') + ->placeholder('Scan the HP') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('kw') ->label('KW') + ->placeholder('Scan the KW') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('volt') ->label('Volt') + ->placeholder('Scan the volt') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('current') ->label('Current') + ->placeholder('Scan the current') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('rpm') ->label('RPM') + ->placeholder('Scan the RPM') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('torque') ->label('Torque') + ->placeholder('Scan the torque') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('frequency') ->label('Frequency') + ->placeholder('Scan the frequency') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); @@ -265,12 +272,14 @@ class MotorTestingMasterResource extends Resource ->reactive(), Forms\Components\TextInput::make('ins_res_limit') ->label('Insulation Resistance Limit') + ->placeholder('Scan the insulation resistance limit') ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }) ->required(), Forms\Components\Select::make('ins_res_type') ->label('Insulation Resistance Type') + ->placeholder('Scan the insulation resistance type') ->default('O') ->selectablePlaceholder(false) ->options(function (callable $get) { @@ -294,96 +303,112 @@ class MotorTestingMasterResource extends Resource }), Forms\Components\TextInput::make('res_ry_ll') ->label('Resistance RY LL') + ->placeholder('Scan the resistance RY LL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('res_ry_ul') ->label('Resistance RY UL') + ->placeholder('Scan the resistance RY UL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('res_yb_ll') ->label('Resistance YB LL') + ->placeholder('Scan the resistance YB LL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('res_yb_ul') ->label('Resistance YB UL') + ->placeholder('Scan the resistance YB UL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('res_br_ll') ->label('Resistance BR LL') + ->placeholder('Scan the resistance BR LL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('res_br_ul') ->label('Resistance BR UL') + ->placeholder('Scan the resistance BR UL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('lock_volt_limit') ->label('Lock Volt Limit') + ->placeholder('Scan the lock volt limit') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('leak_cur_limit') ->label('Leakage Current Limit') + ->placeholder('Scan the leakage current limit') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('lock_cur_ll') ->label('Lock Current LL') + ->placeholder('Scan the lock current LL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('lock_cur_ul') ->label('Lock Current UL') + ->placeholder('Scan the lock current UL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('noload_cur_ll') ->label('No Load Current LL') + ->placeholder('Scan the no load current LL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('noload_cur_ul') ->label('No Load Current UL') + ->placeholder('Scan the no load current UL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('noload_pow_ll') ->label('No Load Power LL') + ->placeholder('Scan the no load power LL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('noload_pow_ul') ->label('No Load Power UL') + ->placeholder('Scan the no load power UL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('noload_spd_ll') ->label('No Load Speed LL') + ->placeholder('Scan the no load speed LL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('noload_spd_ul') ->label('No Load Speed UL') + ->placeholder('Scan the no load speed UL') ->required() ->afterStateUpdated(function (callable $set, callable $get, ?string $state) { $set('updated_by', Filament::auth()->user()?->name); @@ -420,6 +445,7 @@ class MotorTestingMasterResource extends Resource ->sortable(), Tables\Columns\TextColumn::make('item.category') ->label('Category') + ->default('-') ->searchable() ->alignCenter() ->sortable(), @@ -430,6 +456,7 @@ class MotorTestingMasterResource extends Resource ->sortable(), Tables\Columns\TextColumn::make('subassembly_code') ->label('Subassembly Code') + ->default('-') ->searchable() ->alignCenter() ->sortable(), @@ -593,17 +620,34 @@ class MotorTestingMasterResource extends Resource ->options(function (callable $get) { $pId = $get('Plant'); - return Item::whereHas('motorTestingMasters', function ($query) use ($pId) { - if ($pId) { - $query->where('plant_id', $pId); - } - })->pluck('code', 'id'); + if (! $pId) { + return []; + } else { + return Item::whereHas('motorTestingMasters', function ($query) use ($pId) { + if ($pId) { + $query->where('plant_id', $pId); + } + })->pluck('code', 'id'); + } + }) + ->searchable() + ->reactive(), + Select::make('subassembly_code') + ->label('Search by Subassembly Code') + ->nullable() + ->options(function (callable $get) { + $plantId = $get('Plant'); + if (! $plantId) { + return []; + } else { + return MotorTestingMaster::where('plant_id', $plantId)->whereNotNull('subassembly_code')->select('subassembly_code')->distinct()->pluck('subassembly_code', 'subassembly_code'); + } }) ->searchable() ->reactive(), TextInput::make('description') - ->label('Description') - ->placeholder('Enter Description'), + ->label('Model') + ->placeholder('Enter Model'), Radio::make('isi_type') ->label('ISI Model ?') ->boolean() @@ -714,7 +758,7 @@ class MotorTestingMasterResource extends Resource ]) ->query(function ($query, array $data) { // Hide all records initially if no filters are applied - if (empty($data['Plant']) && empty($data['Item']) && empty($data['description']) && empty($data['isi_type']) && empty($data['phase_type']) && empty($data['connection_type']) && empty($data['created_by']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['updated_from']) && empty($data['updated_to'])) {// || $data['isi_type'] == 'All') + if (empty($data['Plant']) && empty($data['Item']) && empty($data['subassembly_code']) && empty($data['description']) && empty($data['isi_type']) && empty($data['phase_type']) && empty($data['connection_type']) && empty($data['created_by']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['updated_from']) && empty($data['updated_to'])) {// || $data['isi_type'] == 'All') return $query->whereRaw('1 = 0'); } @@ -738,6 +782,10 @@ class MotorTestingMasterResource extends Resource } } + if (! empty($data['subassembly_code'])) { + $query->where('subassembly_code', $data['subassembly_code']); + } + if (! empty($data['description'])) { $pId = $data['Plant'] ?? null; $descIds = Item::where('description', 'like', '%'.$data['description'].'%')->whereHas('motorTestingMasters', function ($query) use ($pId) { @@ -807,8 +855,12 @@ class MotorTestingMasterResource extends Resource $indicators[] = 'Item Codes: '.$itemCode; } + if (! empty($data['subassembly_code'])) { + $indicators[] = 'Subassembly Code: '.$data['subassembly_code']; + } + if (! empty($data['description'])) { - $indicators[] = 'Description: '.$data['description']; + $indicators[] = 'Model: '.$data['description']; } if ($data['isi_type'] == 'Y') { -- 2.49.1 From 4de4f35220e05463b417e5f33f28bc5d0ecdfbb6 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 6 Jun 2026 21:58:12 +0530 Subject: [PATCH 2/2] Removed unnecessary columns removed for import transit mail report --- .../mail/import_transit_report.blade.php | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/resources/views/mail/import_transit_report.blade.php b/resources/views/mail/import_transit_report.blade.php index afb89af..2fe5f9c 100644 --- a/resources/views/mail/import_transit_report.blade.php +++ b/resources/views/mail/import_transit_report.blade.php @@ -64,30 +64,17 @@ No CRI RFQ Number - Mail Received Date - Pricol Ref Number + Ref Number Requestor Shipper Shipper Location Shipper Invoice Shipper Invoice Date Custom Agent Name - ETA Date + ETA Status Delivery Location ETD Date - Mode - Inco Terms - Port Of Loading - Port Of Discharge - Delivery City - Packages - Type of package - Gross Weight - Volume - Bill Number - Bill Received Date - Vessel Number Remark @@ -97,7 +84,7 @@ {{ $loop->iteration }} {{ $row['cri_rfq_number'] }} {{-- {{ $row['mail_received_date'] }} --}} - {{ \Carbon\Carbon::parse($row['mail_received_date'])->format('Y-m-d') }} + {{-- {{ \Carbon\Carbon::parse($row['mail_received_date'])->format('Y-m-d') }} --}} {{ $row['pricol_ref_number'] }} {{ $row['requester'] }} {{ $row['shipper'] }} @@ -106,12 +93,13 @@ {{-- {{ $row['shipper_invoice_date'] }} --}} {{ \Carbon\Carbon::parse($row['shipper_invoice_date'])->format('Y-m-d') }} {{ $row['customs_agent_name'] }} - {{ $row['eta_date'] }} + {{-- {{ $row['eta_date'] }} --}} + {{ \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') }} {{ $row['status'] }} {{ $row['delivery_location'] }} {{-- {{ $row['etd_date'] }} --}} {{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }} - {{ $row['mode'] }} + {{-- {{ $row['mode'] }} {{ $row['inco_terms'] }} {{ $row['port_of_loading'] }} {{ $row['port_of_discharge'] }} @@ -120,10 +108,10 @@ {{ $row['type_of_package'] }} {{ $row['gross_weight'] }} {{ $row['volume'] }} - {{ $row['bill_number'] }} + {{ $row['bill_number'] }} --}} {{-- {{ $row['bill_received_date'] }} --}} - {{ \Carbon\Carbon::parse($row['bill_received_date'])->format('Y-m-d') }} - {{ $row['vessel_number'] }} + {{-- {{ \Carbon\Carbon::parse($row['bill_received_date'])->format('Y-m-d') }} + {{ $row['vessel_number'] }} --}} {{ $row['remark'] }} @endforeach -- 2.49.1