Added panel box validation in invoice data table
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 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 4m36s
Laravel Larastan / larastan (pull_request) Failing after 5m36s

This commit is contained in:
dhanabalan
2026-08-26 14:44:55 +05:30
parent 3aaf821040
commit 621312f5c9

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)