Added not ok logic in invoice validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Laravel Pint / pint (pull_request) Successful in 2m17s
Laravel Larastan / larastan (pull_request) Failing after 4m8s

This commit is contained in:
dhanabalan
2026-11-20 10:22:44 +05:30
parent fd04f57fde
commit f2b4fdc33e

View File

@@ -12,6 +12,7 @@ use App\Models\Item;
use App\Models\Plant; use App\Models\Plant;
use App\Models\StickerMaster; use App\Models\StickerMaster;
use App\Models\WireMasterPacking; use App\Models\WireMasterPacking;
use App\Models\PanelBoxValidation;
use DB; use DB;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
@@ -4093,6 +4094,30 @@ class CreateInvoiceValidation extends CreateRecord
return; return;
} }
$notOkPanelBox = PanelBoxValidation::where('plant_id', $plantId)->where('panel_box_supplier', $supplierNo)->where('panel_box_serial_number', $supplierSNo)->first();
if($notOkPanelBox->status == 'NotOK'){
Notification::make()
->title('Not Ok Serial Number')
->body("scanned panel box serial number '$serialNumber' failed testing (NOT OK). Please scan the serial number of an OK panel box..")
->danger()
->seconds(3)
->send();
$this->dispatch('playWarnSound');
$this->form->fill([
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'serial_number' => null,
'total_quantity' => $totQuan,
'update_invoice' => false,
'scanned_quantity' => $scanSQuan,
]);
return;
}
$invoiceUpdate = InvoiceValidation::where('plant_id', $plantId) $invoiceUpdate = InvoiceValidation::where('plant_id', $plantId)
->where('invoice_number', $invoiceNumber) ->where('invoice_number', $invoiceNumber)
->where('sticker_master_id', $record1->sticker_master_id) ->where('sticker_master_id', $record1->sticker_master_id)