Added not ok logic in invoice validation #1485
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user