Added status in filter and modified logic in rework action
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 5m8s
Laravel Larastan / larastan (pull_request) Failing after 5m24s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 5m8s
Laravel Larastan / larastan (pull_request) Failing after 5m24s
This commit is contained in:
@@ -1003,6 +1003,10 @@ class PanelBoxValidationResource extends Resource
|
|||||||
->where('inspection_lot_number', $inspecLotNo)
|
->where('inspection_lot_number', $inspecLotNo)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
$alreadyExistsSupplier = PanelBoxValidation::where('serial_number', $serialNumber)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
if ($alreadyExists) {
|
if ($alreadyExists) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Duplicate Found')
|
->title('Duplicate Found')
|
||||||
@@ -1016,9 +1020,9 @@ class PanelBoxValidationResource extends Resource
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(!$alreadyExists)
|
if($alreadyExistsSupplier)
|
||||||
{
|
{
|
||||||
if($alreadyExists->panel_box_supplier != $supplierNo){
|
if($alreadyExistsSupplier->panel_box_supplier != $supplierNo){
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Supplier Mismatch')
|
->title('Supplier Mismatch')
|
||||||
->body(
|
->body(
|
||||||
@@ -2007,6 +2011,13 @@ class PanelBoxValidationResource extends Resource
|
|||||||
0 => 'No',
|
0 => 'No',
|
||||||
])
|
])
|
||||||
->reactive(),
|
->reactive(),
|
||||||
|
Select::make('status')
|
||||||
|
->label('Status')
|
||||||
|
->options([
|
||||||
|
'Ok' => 'Ok',
|
||||||
|
'NotOk' => 'Not Ok',
|
||||||
|
])
|
||||||
|
->reactive(),
|
||||||
DateTimePicker::make(name: 'created_from')
|
DateTimePicker::make(name: 'created_from')
|
||||||
->label('Created From')
|
->label('Created From')
|
||||||
->placeholder('Select From DateTime')
|
->placeholder('Select From DateTime')
|
||||||
@@ -2020,7 +2031,7 @@ class PanelBoxValidationResource 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['production_order']) && empty($data['serial_number']) && empty($data['inspection_lot_number']) && empty($data['panel_box_code']) && empty($data['rework_count']) && empty($data['created_from']) && empty($data['created_to'])) {
|
if (empty($data['Plant']) && empty($data['Line']) && empty($data['Item']) && empty($data['production_order']) && empty($data['serial_number']) && empty($data['inspection_lot_number']) && empty($data['panel_box_code']) && empty($data['rework_count']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
|
||||||
return $query->whereRaw('1 = 0');
|
return $query->whereRaw('1 = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2073,6 +2084,10 @@ class PanelBoxValidationResource extends Resource
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($data['status'])) {
|
||||||
|
$query->where('status', $data['status']);
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($data['created_from'])) {
|
if (! empty($data['created_from'])) {
|
||||||
$query->where('created_at', '>=', $data['created_from']);
|
$query->where('created_at', '>=', $data['created_from']);
|
||||||
}
|
}
|
||||||
@@ -2119,6 +2134,10 @@ class PanelBoxValidationResource extends Resource
|
|||||||
$indicators[] = 'Panel Box Code: '.$data['panel_box_code'];
|
$indicators[] = 'Panel Box Code: '.$data['panel_box_code'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($data['status'])) {
|
||||||
|
$indicators[] = 'Status: '.$data['status'];
|
||||||
|
}
|
||||||
|
|
||||||
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