Added characteristics type in product characteristics master filter
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 30s
Laravel Pint / pint (pull_request) Successful in 2m2s
Laravel Larastan / larastan (pull_request) Failing after 3m9s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Failing after 30s
Laravel Pint / pint (pull_request) Successful in 2m2s
Laravel Larastan / larastan (pull_request) Failing after 3m9s
This commit is contained in:
@@ -417,12 +417,12 @@ class ProductCharacteristicsMasterResource extends Resource
|
|||||||
// TextInput::make('coil_number')
|
// TextInput::make('coil_number')
|
||||||
// ->label('Coil Number')
|
// ->label('Coil Number')
|
||||||
// ->placeholder(placeholder: 'Enter Coil Number'),
|
// ->placeholder(placeholder: 'Enter Coil Number'),
|
||||||
// Select::make('status')
|
Select::make('characteristics_type')
|
||||||
// ->label('Status')
|
->label('Characteristics Type')
|
||||||
// ->options([
|
->options([
|
||||||
// 'Ok' => 'OK',
|
'Product' => 'Product',
|
||||||
// 'NotOk' => 'Not Ok'
|
'Process' => 'Process'
|
||||||
// ]),
|
]),
|
||||||
DateTimePicker::make(name: 'created_from')
|
DateTimePicker::make(name: 'created_from')
|
||||||
->label('Created From')
|
->label('Created From')
|
||||||
->placeholder(placeholder: 'Select From DateTime')
|
->placeholder(placeholder: 'Select From DateTime')
|
||||||
@@ -436,7 +436,7 @@ class ProductCharacteristicsMasterResource extends Resource
|
|||||||
])
|
])
|
||||||
->query(function ($query, array $data) {
|
->query(function ($query, array $data) {
|
||||||
// Hide all records initially if no filters are applied
|
// Hide all records initially if no filters are applied
|
||||||
if (empty($data['Plant']) && empty($data['Line']) && empty($data['Item']) && empty($data['work_group_master']) && empty($data['Machine']) && empty($data['created_from']) && empty($data['created_to'])) {
|
if (empty($data['Plant']) && empty($data['Line']) && empty($data['Item']) && empty($data['work_group_master']) && empty($data['Machine']) && empty($data['characteristics_type']) && empty($data['created_from']) && empty($data['created_to'])) {
|
||||||
return $query->whereRaw('1 = 0');
|
return $query->whereRaw('1 = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -460,6 +460,10 @@ class ProductCharacteristicsMasterResource extends Resource
|
|||||||
$query->where('machine_id', $data['Machine']);
|
$query->where('machine_id', $data['Machine']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($data['characteristics_type'])) {
|
||||||
|
$query->where('characteristics_type', $data['characteristics_type']);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($data['created_from'])) {
|
if (!empty($data['created_from'])) {
|
||||||
$query->where('created_at', '>=', $data['created_from']);
|
$query->where('created_at', '>=', $data['created_from']);
|
||||||
}
|
}
|
||||||
@@ -494,6 +498,10 @@ class ProductCharacteristicsMasterResource extends Resource
|
|||||||
$indicators[] = 'Machine: ' . Machine::where('id', $data['Machine'])->value('work_center');
|
$indicators[] = 'Machine: ' . Machine::where('id', $data['Machine'])->value('work_center');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($data['characteristics_type'])) {
|
||||||
|
$indicators[] = 'Characteristics Type: ' . $data['characteristics_type'];
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($data['created_from'])) {
|
if (!empty($data['created_from'])) {
|
||||||
$indicators[] = 'From: ' . $data['created_from'];
|
$indicators[] = 'From: ' . $data['created_from'];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user