Added rework logic in panel check list livewire page
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 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 3m34s
Laravel Larastan / larastan (pull_request) Failing after 7m16s

This commit is contained in:
dhanabalan
2026-08-26 12:15:18 +05:30
parent d676e2f659
commit 3aaf821040

View File

@@ -113,14 +113,14 @@ public $records = [];
$plan = Plant::find($this->data['plant_id']);
if ($exists) {
Notification::make()
->title('Duplicate Serial Number')
->body("serial number {$this->data['serial_number']} already exists for the selected plant $plan->code.")
->danger()
->send();
return;
}
// if ($exists) {
// Notification::make()
// ->title('Duplicate Serial Number')
// ->body("serial number {$this->data['serial_number']} already exists for the selected plant $plan->code.")
// ->danger()
// ->send();
// return;
// }
if(!$this->selectForNotOk){
@@ -177,29 +177,59 @@ public $records = [];
}
}
$qualityValidation = PanelBoxValidation::create([
'plant_id' => $this->data['plant_id'] ?? null,
'line_id' => $this->data['line_id'] ?? null,
'sticker_master_id' => $this->data['sticker_master_id'] ?? null,
'production_order' => $this->data['production_order'] ?? null,
'serial_number' => $this->data['serial_number'] ?? null,
'serial_number_panel' => $this->data['serial_number_panel'] ?? null,
'pack_slip_panel' => $this->data['pack_slip_panel'] ?? null,
'name_plate_panel' => $this->data['name_plate_panel'] ?? null,
'tube_sticker_panel' => $this->data['tube_sticker_panel'] ?? null,
'warranty_card_panel' => $this->data['warranty_card_panel'] ?? null,
'part_validation1' => $this->data['part_validation1'] ?? null,
'part_validation2' => $this->data['part_validation2'] ?? null,
'part_validation3' => $this->data['part_validation3'] ?? null,
'part_validation4' => $this->data['part_validation4'] ?? null,
'part_validation5' => $this->data['part_validation5'] ?? null,
'panel_box_supplier' => $this->data['panel_box_supplier'] ?? null,
'panel_box_serial_number' => $this->data['panel_box_serial_number'] ?? null,
'panel_box_code' => $this->data['panel_box_code'] ?? null,
'inspection_lot_number' => $this->data['inspection_lot_number'] ?? null,
'created_by' => $this->data['created_by'] ?? null,
'updated_by' => $this->data['updated_by'] ?? null,
]);
$latestReworkRecord = PanelBoxValidation::where('plant_id', $this->data['plant_id'] ?? null)->where('serial_number', $this->data['serial_number'] ?? null)->latest()->first();
if($latestReworkRecord){
$qualityValidation = PanelBoxValidation::create([
'plant_id' => $this->data['plant_id'] ?? null,
'line_id' => $this->data['line_id'] ?? null,
'sticker_master_id' => $this->data['sticker_master_id'] ?? null,
'production_order' => $this->data['production_order'] ?? null,
'serial_number' => $this->data['serial_number'] ?? null,
'serial_number_panel' => $this->data['serial_number_panel'] ?? null,
'pack_slip_panel' => $this->data['pack_slip_panel'] ?? null,
'name_plate_panel' => $this->data['name_plate_panel'] ?? null,
'tube_sticker_panel' => $this->data['tube_sticker_panel'] ?? null,
'warranty_card_panel' => $this->data['warranty_card_panel'] ?? null,
'part_validation1' => $this->data['part_validation1'] ?? null,
'part_validation2' => $this->data['part_validation2'] ?? null,
'part_validation3' => $this->data['part_validation3'] ?? null,
'part_validation4' => $this->data['part_validation4'] ?? null,
'part_validation5' => $this->data['part_validation5'] ?? null,
'panel_box_supplier' => $this->data['panel_box_supplier'] ?? null,
'panel_box_serial_number' => $this->data['panel_box_serial_number'] ?? null,
'panel_box_code' => $this->data['panel_box_code'] ?? null,
'inspection_lot_number' => $this->data['inspection_lot_number'] ?? null,
'rework_count' => $latestReworkRecord ? ((int) $latestReworkRecord->rework_count + 1) : 0,
'created_by' => $this->data['created_by'] ?? null,
'updated_by' => $this->data['updated_by'] ?? null,
]);
}
else{
$qualityValidation = PanelBoxValidation::create([
'plant_id' => $this->data['plant_id'] ?? null,
'line_id' => $this->data['line_id'] ?? null,
'sticker_master_id' => $this->data['sticker_master_id'] ?? null,
'production_order' => $this->data['production_order'] ?? null,
'serial_number' => $this->data['serial_number'] ?? null,
'serial_number_panel' => $this->data['serial_number_panel'] ?? null,
'pack_slip_panel' => $this->data['pack_slip_panel'] ?? null,
'name_plate_panel' => $this->data['name_plate_panel'] ?? null,
'tube_sticker_panel' => $this->data['tube_sticker_panel'] ?? null,
'warranty_card_panel' => $this->data['warranty_card_panel'] ?? null,
'part_validation1' => $this->data['part_validation1'] ?? null,
'part_validation2' => $this->data['part_validation2'] ?? null,
'part_validation3' => $this->data['part_validation3'] ?? null,
'part_validation4' => $this->data['part_validation4'] ?? null,
'part_validation5' => $this->data['part_validation5'] ?? null,
'panel_box_supplier' => $this->data['panel_box_supplier'] ?? null,
'panel_box_serial_number' => $this->data['panel_box_serial_number'] ?? null,
'panel_box_code' => $this->data['panel_box_code'] ?? null,
'inspection_lot_number' => $this->data['inspection_lot_number'] ?? null,
'created_by' => $this->data['created_by'] ?? null,
'updated_by' => $this->data['updated_by'] ?? null,
]);
}
if (! $qualityValidation || ! $qualityValidation->exists) {
Notification::make()