change dlogic in panel box inspection
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 5m21s
Laravel Larastan / larastan (pull_request) Failing after 6m1s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 5m21s
Laravel Larastan / larastan (pull_request) Failing after 6m1s
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user