From bbcb2ba02088917fecbc00573b65bbbc0a5f0eb1 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 26 Aug 2026 17:22:14 +0530 Subject: [PATCH 1/2] bug solved in panel box validation --- .../Resources/PanelBoxValidationResource.php | 69 ++++++++----------- 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/app/Filament/Resources/PanelBoxValidationResource.php b/app/Filament/Resources/PanelBoxValidationResource.php index 45e4522..87ae0b3 100644 --- a/app/Filament/Resources/PanelBoxValidationResource.php +++ b/app/Filament/Resources/PanelBoxValidationResource.php @@ -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') -- 2.49.1 From 955c4b97e75bf5edf22d6dfc1a10c584bb914ef7 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 26 Aug 2026 17:23:10 +0530 Subject: [PATCH 2/2] commented quality inspection notification in invoice data table --- app/Livewire/InvoiceDataTable.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/Livewire/InvoiceDataTable.php b/app/Livewire/InvoiceDataTable.php index f6bbc6f..75fb121 100644 --- a/app/Livewire/InvoiceDataTable.php +++ b/app/Livewire/InvoiceDataTable.php @@ -846,24 +846,24 @@ class InvoiceDataTable extends Component return; } - $categoryExist = Item::where('code', $itemCode)->first(); + // $categoryExist = Item::where('code', $itemCode)->first(); - if($categoryExist?->category == 'Panel Box'){ + // if($categoryExist?->category == 'Panel Box'){ - $panelExist = PanelBoxValidation::where('panel_box_serial_number', $serialNumber)->where('panel_box_code', $itemCode)->where('panel_box_supplier', $supplier)->first(); + // $panelExist = PanelBoxValidation::where('panel_box_serial_number', $serialNumber)->where('panel_box_code', $itemCode)->where('panel_box_supplier', $supplier)->first(); - if(!$panelExist){ - Notification::make() - ->title('Panel Not Verified') - ->body("Panel Quality Inspection failed.
Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.
") - ->danger() - ->seconds(2) - ->send(); - $this->capacitorInput = ''; + // if(!$panelExist){ + // Notification::make() + // ->title('Panel Not Verified') + // ->body("Panel Quality Inspection failed.
Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.
") + // ->danger() + // ->seconds(2) + // ->send(); + // $this->capacitorInput = ''; - return; - } - } + // return; + // } + // } $this->package = InvoiceValidation::with('stickerMasterRelation') ->where('invoice_number', $this->invoiceNumber) -- 2.49.1