Merge pull request 'Added panel box validation in invoice data table' (#941) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s

Reviewed-on: #941
This commit was merged in pull request #941.
This commit is contained in:
2026-08-26 09:16:18 +00:00

View File

@@ -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.<br>Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.</br>")
->danger()
->seconds(2)
->send();
$this->capacitorInput = '';
return;
}
}
$this->package = InvoiceValidation::with('stickerMasterRelation')
->where('invoice_number', $this->invoiceNumber)
->where('plant_id', $this->plantId)