bug solved in panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s

This commit is contained in:
dhanabalan
2026-08-26 17:22:14 +05:30
parent d8364b368e
commit bbcb2ba020

View File

@@ -808,14 +808,7 @@ class PanelBoxValidationResource extends Resource
}
}
// $okSerialExists = ProductionCharacteristic::where('serial_number', $serialNumber)->where('plant_id', $plantId)->get();
// if($okSerialExists){
// }
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->latest()->first();
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
// if ($serialExists) {
// $set('serial_exists', true);
@@ -995,28 +988,6 @@ class PanelBoxValidationResource extends Resource
$pOrder = $get('production_order');
$inspecLotNo = $get('inspection_lot_number');
// $serialRecords = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->get();
// if ($serialRecords->isNotEmpty()) {
// $alreadyExists = $serialRecords->contains(function ($record) use ($pOrder, $inspecLotNo) {
// return $record->production_order == $pOrder
// && $record->inspection_lot_number == $inspecLotNo;
// });
// if ($alreadyExists) {
// Notification::make()
// ->title('Invalid Rework')
// ->body(
// 'This document number and inspection lot number have already been used for this serial number. Please provide a new document number and inspection lot number.'
// )
// ->danger()
// ->send();
// return;
// }
// }
$alreadyExists = PanelBoxValidation::where('serial_number', $serialNumber)
->where('plant_id', $plantId)
->where('production_order', $pOrder)
@@ -1034,19 +1005,37 @@ class PanelBoxValidationResource extends Resource
return;
}
else
{
// $livewire->showChecklist = true;
// $data = $livewire->data;
$data = $get();
$data = $get();
if ($livewire->checkIfHasCharacteristics($data)) {
$hasCharacteristics = $livewire->checkIfHasCharacteristics($data);
$livewire->showChecklist = true;
$livewire->dispatch('close-modal');
return;
}
\Log::info('CHARACTERISTICS RESULT', [
'hasCharacteristics' => $hasCharacteristics,
]);
if ($hasCharacteristics) {
\Log::info('SETTING SHOW CHECKLIST TRUE');
$livewire->showChecklist = true;
$livewire->dispatch('close-modal');
return;
}
// else
// {
// // $livewire->showChecklist = true;
// // $data = $livewire->data;
// $data = $get();
// if ($livewire->checkIfHasCharacteristics($data)) {
// $livewire->showChecklist = true;
// $livewire->dispatch('close-modal');
// return;
// }
// }
}),
]),
Forms\Components\Hidden::make('part_validation_type_options')