Added panel box validation in invoice data table #941
@@ -3,6 +3,8 @@
|
|||||||
namespace App\Livewire;
|
namespace App\Livewire;
|
||||||
|
|
||||||
use App\Models\InvoiceValidation;
|
use App\Models\InvoiceValidation;
|
||||||
|
use App\Models\Item;
|
||||||
|
use App\Models\PanelBoxValidation;
|
||||||
use App\Models\StickerMaster;
|
use App\Models\StickerMaster;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
@@ -844,6 +846,25 @@ class InvoiceDataTable extends Component
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$categoryExist = Item::where('code', $itemCode)->first();
|
||||||
|
|
||||||
|
if($categoryExist?->category == 'Panel Box'){
|
||||||
|
|
||||||
|
$panelExist = PanelBoxValidation::where('panel_box_serial_number', $serialNumber)->where('panel_box_code', $itemCode)->where('panel_box_supplier', $supplier)->first();
|
||||||
|
|
||||||
|
if(!$panelExist){
|
||||||
|
Notification::make()
|
||||||
|
->title('Panel Not Verified')
|
||||||
|
->body("Panel Quality Inspection failed.<br>Panel Box Code: $itemCode, Item Code: {$this->currentItemCode}, Serial Number: $serialNumber.</br>")
|
||||||
|
->danger()
|
||||||
|
->seconds(2)
|
||||||
|
->send();
|
||||||
|
$this->capacitorInput = '';
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->package = InvoiceValidation::with('stickerMasterRelation')
|
$this->package = InvoiceValidation::with('stickerMasterRelation')
|
||||||
->where('invoice_number', $this->invoiceNumber)
|
->where('invoice_number', $this->invoiceNumber)
|
||||||
->where('plant_id', $this->plantId)
|
->where('plant_id', $this->plantId)
|
||||||
|
|||||||
Reference in New Issue
Block a user