Added supplier number logic and status column in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m1s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 22s
Laravel Larastan / larastan (pull_request) Failing after 5m44s
Laravel Pint / pint (pull_request) Successful in 5m10s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m1s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 22s
Laravel Larastan / larastan (pull_request) Failing after 5m44s
Laravel Pint / pint (pull_request) Successful in 5m10s
This commit is contained in:
@@ -976,7 +976,6 @@ class PanelBoxValidationResource extends Resource
|
|||||||
->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
|
->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
|
||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
Forms\Components\Hidden::make('serial_exists')
|
Forms\Components\Hidden::make('serial_exists')
|
||||||
// ->default(false)
|
|
||||||
->live()
|
->live()
|
||||||
->dehydrated()
|
->dehydrated()
|
||||||
->id('serial_exists'),
|
->id('serial_exists'),
|
||||||
@@ -996,6 +995,7 @@ class PanelBoxValidationResource extends Resource
|
|||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
$pOrder = $get('production_order');
|
$pOrder = $get('production_order');
|
||||||
$inspecLotNo = $get('inspection_lot_number');
|
$inspecLotNo = $get('inspection_lot_number');
|
||||||
|
$supplierNo = $get('panel_box_supplier');
|
||||||
|
|
||||||
$alreadyExists = PanelBoxValidation::where('serial_number', $serialNumber)
|
$alreadyExists = PanelBoxValidation::where('serial_number', $serialNumber)
|
||||||
->where('plant_id', $plantId)
|
->where('plant_id', $plantId)
|
||||||
@@ -1016,18 +1016,29 @@ class PanelBoxValidationResource extends Resource
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if(!$alreadyExists)
|
||||||
|
{
|
||||||
|
if($alreadyExists->panel_box_supplier != $supplierNo){
|
||||||
|
Notification::make()
|
||||||
|
->title('Supplier Mismatch')
|
||||||
|
->body(
|
||||||
|
'Supplier number does not match the existing record for this serial number. Please check the supplier number.'
|
||||||
|
)
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
|
||||||
|
$livewire->showChecklist = false;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data = $get();
|
$data = $get();
|
||||||
|
|
||||||
$hasCharacteristics = $livewire->checkIfHasCharacteristics($data);
|
$hasCharacteristics = $livewire->checkIfHasCharacteristics($data);
|
||||||
|
|
||||||
\Log::info('CHARACTERISTICS RESULT', [
|
|
||||||
'hasCharacteristics' => $hasCharacteristics,
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($hasCharacteristics) {
|
if ($hasCharacteristics) {
|
||||||
|
|
||||||
\Log::info('SETTING SHOW CHECKLIST TRUE');
|
|
||||||
|
|
||||||
$livewire->showChecklist = true;
|
$livewire->showChecklist = true;
|
||||||
$livewire->dispatch('close-modal');
|
$livewire->dispatch('close-modal');
|
||||||
return;
|
return;
|
||||||
@@ -1868,6 +1879,16 @@ class PanelBoxValidationResource extends Resource
|
|||||||
->alignCenter()
|
->alignCenter()
|
||||||
->searchable()
|
->searchable()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('status')
|
||||||
|
->label('Status')
|
||||||
|
->alignCenter()
|
||||||
|
->searchable()
|
||||||
|
->sortable()
|
||||||
|
->color(fn (string $state): string => match ($state) {
|
||||||
|
'Ok' => 'success',
|
||||||
|
'NotOk' => 'danger',
|
||||||
|
default => 'gray',
|
||||||
|
}),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
->label('Created At')
|
->label('Created At')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
Reference in New Issue
Block a user