change dlogic in panel box inspection #1317

Merged
jothi merged 1 commits from ranjith-dev into master 2026-10-27 04:43:51 +00:00

View File

@@ -17,6 +17,7 @@ use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Facades\Filament;
use Illuminate\Support\Facades\Auth;
use App\Models\InvoiceValidation;
class PanelBoxInspectionStock extends Page
{
@@ -445,6 +446,23 @@ class PanelBoxInspectionStock extends Page
}
}
$panelExistsInvoice = InvoiceValidation::where('plant_id', $this->plantId)
->where('panel_box_serial_number', $serialNumber)
// ->where('panel_box_code', $itemCode)
->where('panel_box_supplier', $supplier)
->first();
if ($panelExistsInvoice) {
Notification::make()
->title('Duplicate Panel Box Serial Number')
->body("Duplicate panel already exists.<br>Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber, Supplier Number: $supplier against invoice Number: $panelExistsInvoice->invoice_number")
->danger()
->seconds(2)
->send();
return;
}
$serialExists = PanelBoxValidation::where('plant_id', $plantId)->where('serial_number', $serialNumber)->where('panel_box_supplier', $supplier)->first();
if ($serialExists) {