Merge pull request 'ranjith-dev' (#717) from ranjith-dev into master
Reviewed-on: poc/pds#717
This commit is contained in:
@@ -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') {
|
||||
|
||||
@@ -64,30 +64,17 @@
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>CRI RFQ Number</th>
|
||||
<th>Mail Received Date</th>
|
||||
<th>Pricol Ref Number</th>
|
||||
<th>Ref Number</th>
|
||||
<th>Requestor</th>
|
||||
<th>Shipper</th>
|
||||
<th>Shipper Location</th>
|
||||
<th>Shipper Invoice</th>
|
||||
<th>Shipper Invoice Date</th>
|
||||
<th>Custom Agent Name</th>
|
||||
<th>ETA Date</th>
|
||||
<th>ETA</th>
|
||||
<th>Status</th>
|
||||
<th>Delivery Location</th>
|
||||
<th>ETD Date</th>
|
||||
<th>Mode</th>
|
||||
<th>Inco Terms</th>
|
||||
<th>Port Of Loading</th>
|
||||
<th>Port Of Discharge</th>
|
||||
<th>Delivery City</th>
|
||||
<th>Packages</th>
|
||||
<th>Type of package</th>
|
||||
<th>Gross Weight</th>
|
||||
<th>Volume</th>
|
||||
<th>Bill Number</th>
|
||||
<th>Bill Received Date</th>
|
||||
<th>Vessel Number</th>
|
||||
<th>Remark</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -97,7 +84,7 @@
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $row['cri_rfq_number'] }}</td>
|
||||
{{-- <td>{{ $row['mail_received_date'] }}</td> --}}
|
||||
<td>{{ \Carbon\Carbon::parse($row['mail_received_date'])->format('Y-m-d') }}</td>
|
||||
{{-- <td>{{ \Carbon\Carbon::parse($row['mail_received_date'])->format('Y-m-d') }}</td> --}}
|
||||
<td>{{ $row['pricol_ref_number'] }}</td>
|
||||
<td>{{ $row['requester'] }}</td>
|
||||
<td>{{ $row['shipper'] }}</td>
|
||||
@@ -106,12 +93,13 @@
|
||||
{{-- <td>{{ $row['shipper_invoice_date'] }}</td> --}}
|
||||
<td>{{ \Carbon\Carbon::parse($row['shipper_invoice_date'])->format('Y-m-d') }}</td>
|
||||
<td>{{ $row['customs_agent_name'] }}</td>
|
||||
<td>{{ $row['eta_date'] }}</td>
|
||||
{{-- <td>{{ $row['eta_date'] }}</td> --}}
|
||||
<td>{{ \Carbon\Carbon::parse($row['eta_date'])->format('Y-m-d') }}</td>
|
||||
<td>{{ $row['status'] }}</td>
|
||||
<td>{{ $row['delivery_location'] }}</td>
|
||||
{{-- <td>{{ $row['etd_date'] }}</td> --}}
|
||||
<td>{{ \Carbon\Carbon::parse($row['etd_date'])->format('Y-m-d') }}</td>
|
||||
<td>{{ $row['mode'] }}</td>
|
||||
{{-- <td>{{ $row['mode'] }}</td>
|
||||
<td>{{ $row['inco_terms'] }}</td>
|
||||
<td>{{ $row['port_of_loading'] }}</td>
|
||||
<td>{{ $row['port_of_discharge'] }}</td>
|
||||
@@ -120,10 +108,10 @@
|
||||
<td>{{ $row['type_of_package'] }}</td>
|
||||
<td>{{ $row['gross_weight'] }}</td>
|
||||
<td>{{ $row['volume'] }}</td>
|
||||
<td>{{ $row['bill_number'] }}</td>
|
||||
<td>{{ $row['bill_number'] }}</td> --}}
|
||||
{{-- <td>{{ $row['bill_received_date'] }}</td> --}}
|
||||
<td>{{ \Carbon\Carbon::parse($row['bill_received_date'])->format('Y-m-d') }}</td>
|
||||
<td>{{ $row['vessel_number'] }}</td>
|
||||
{{-- <td>{{ \Carbon\Carbon::parse($row['bill_received_date'])->format('Y-m-d') }}</td>
|
||||
<td>{{ $row['vessel_number'] }}</td> --}}
|
||||
<td>{{ $row['remark'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user