Compare commits
3 Commits
5da6cb5132
...
4ea2cafb40
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ea2cafb40 | |||
|
|
bb5e088b02 | ||
|
|
393ea6a4bd |
@@ -810,21 +810,21 @@ class PanelBoxValidationResource extends Resource
|
|||||||
|
|
||||||
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
|
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->first();
|
||||||
|
|
||||||
if ($serialExists) {
|
// if ($serialExists) {
|
||||||
$set('serial_exists', true);
|
// $set('serial_exists', true);
|
||||||
} else {
|
// } else {
|
||||||
$set('serial_exists', false);
|
// $set('serial_exists', false);
|
||||||
}
|
|
||||||
|
|
||||||
// if ($serialExists && ! $get('id')) {
|
|
||||||
// $set('validationError', 'Serial number already exists in panel box validation.');
|
|
||||||
// $set('sticker_master_id', null);
|
|
||||||
// $set('uom', null);
|
|
||||||
// $set('serial_number', null);
|
|
||||||
|
|
||||||
// return;
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if ($serialExists && ! $get('id')) {
|
||||||
|
$set('validationError', 'Serial number already exists in panel box validation.');
|
||||||
|
$set('sticker_master_id', null);
|
||||||
|
$set('uom', null);
|
||||||
|
$set('serial_number', null);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$set('validationError', null);
|
$set('validationError', null);
|
||||||
|
|
||||||
foreach ($serialFields as $column) {
|
foreach ($serialFields as $column) {
|
||||||
|
|||||||
@@ -177,60 +177,35 @@ public $records = [];
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$latestReworkRecord = PanelBoxValidation::where('plant_id', $this->data['plant_id'] ?? null)->where('serial_number', $this->data['serial_number'] ?? null)->latest()->first();
|
// $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($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([
|
// $qualityValidation = PanelBoxValidation::create([
|
||||||
// 'plant_id' => $this->data['plant_id'] ?? null,
|
// 'plant_id' => $this->data['plant_id'] ?? null,
|
||||||
// 'line_id' => $this->data['line_id'] ?? null,
|
// 'line_id' => $this->data['line_id'] ?? null,
|
||||||
@@ -254,6 +229,31 @@ public $records = [];
|
|||||||
// 'created_by' => $this->data['created_by'] ?? null,
|
// 'created_by' => $this->data['created_by'] ?? null,
|
||||||
// 'updated_by' => $this->data['updated_by'] ?? null,
|
// 'updated_by' => $this->data['updated_by'] ?? null,
|
||||||
// ]);
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
$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) {
|
if (! $qualityValidation || ! $qualityValidation->exists) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
|
|||||||
Reference in New Issue
Block a user