Merge pull request 'Added not ok logic in invoice validation' (#1485) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s

Reviewed-on: #1485
This commit was merged in pull request #1485.
This commit is contained in:
2026-11-20 04:53:04 +00:00

View File

@@ -12,6 +12,7 @@ use App\Models\Item;
use App\Models\Plant;
use App\Models\StickerMaster;
use App\Models\WireMasterPacking;
use App\Models\PanelBoxValidation;
use DB;
use Filament\Facades\Filament;
use Filament\Notifications\Notification;
@@ -4093,6 +4094,30 @@ class CreateInvoiceValidation extends CreateRecord
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)
->where('invoice_number', $invoiceNumber)
->where('sticker_master_id', $record1->sticker_master_id)