From 621312f5c927198ec117c777c66f73d65199163a Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 26 Aug 2026 14:44:55 +0530 Subject: [PATCH] Added panel box validation in invoice data table --- app/Livewire/InvoiceDataTable.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/Livewire/InvoiceDataTable.php b/app/Livewire/InvoiceDataTable.php index bbe239b..f6bbc6f 100644 --- a/app/Livewire/InvoiceDataTable.php +++ b/app/Livewire/InvoiceDataTable.php @@ -3,6 +3,8 @@ namespace App\Livewire; use App\Models\InvoiceValidation; +use App\Models\Item; +use App\Models\PanelBoxValidation; use App\Models\StickerMaster; use Filament\Facades\Filament; use Filament\Notifications\Notification; @@ -844,6 +846,25 @@ class InvoiceDataTable extends Component return; } + $categoryExist = Item::where('code', $itemCode)->first(); + + if($categoryExist?->category == 'Panel Box'){ + + $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 = ''; + + return; + } + } + $this->package = InvoiceValidation::with('stickerMasterRelation') ->where('invoice_number', $this->invoiceNumber) ->where('plant_id', $this->plantId) -- 2.49.1