Added invoice finder pages and livewire pages
This commit is contained in:
215
app/Filament/Pages/InvoiceFinder.php
Normal file
215
app/Filament/Pages/InvoiceFinder.php
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Pages;
|
||||||
|
|
||||||
|
use App\Models\LocatorInvoiceValidation;
|
||||||
|
use App\Models\PalletValidation;
|
||||||
|
use App\Models\Plant;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Filament\Forms\Contracts\HasForms;
|
||||||
|
use Filament\Forms\Concerns\InteractsWithForms;
|
||||||
|
use Filament\Pages\Page;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Notifications\Notification;
|
||||||
|
|
||||||
|
class InvoiceFinder extends Page implements HasForms
|
||||||
|
{
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-document-text';
|
||||||
|
|
||||||
|
protected static string $view = 'filament.pages.invoice-finder';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Export Dispatch';
|
||||||
|
|
||||||
|
//use InteractsWithForms;
|
||||||
|
|
||||||
|
public $pId, $invoiceNumber;
|
||||||
|
|
||||||
|
public array $invoiceOverviewData = [];
|
||||||
|
|
||||||
|
public array $filters = [];
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->statePath('filters')
|
||||||
|
->schema([
|
||||||
|
Section::make('') // You can give your section a title or leave it blank
|
||||||
|
->schema([
|
||||||
|
Select::make('plant_id')
|
||||||
|
->options(Plant::pluck('name', 'id'))
|
||||||
|
->label('Plant')
|
||||||
|
->reactive()
|
||||||
|
->required(),
|
||||||
|
TextInput::make('scan_invoice')
|
||||||
|
->label('Scan Invoice')
|
||||||
|
->required()
|
||||||
|
->reactive()
|
||||||
|
->extraAttributes([
|
||||||
|
'wire:keydown.enter' => 'processInvoiceNo($event.target.value)',
|
||||||
|
]),
|
||||||
|
TextInput::make('scan_quantity')
|
||||||
|
->label('Scanned Quantity ')
|
||||||
|
->readOnly()
|
||||||
|
->reactive(),
|
||||||
|
TextInput::make('pending_quantity')
|
||||||
|
->label('Pending Quantity')
|
||||||
|
->readOnly()
|
||||||
|
->reactive(),
|
||||||
|
TextInput::make('total_sno_quantity')
|
||||||
|
->label('Total SNo. Quantity')
|
||||||
|
->readOnly()
|
||||||
|
->reactive(),
|
||||||
|
|
||||||
|
])
|
||||||
|
->columns(5)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function processInvoiceNo($invoiceNo)
|
||||||
|
{
|
||||||
|
$plantId = $this->form->getState()['plant_id'];
|
||||||
|
|
||||||
|
if(!$invoiceNo)
|
||||||
|
{
|
||||||
|
Notification::make()
|
||||||
|
->title("Invoice number '$invoiceNo' can't be empty!")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$this->dispatch('loadData', '', [], [], [], [], $plantId);
|
||||||
|
$this->form->fill([
|
||||||
|
'plant_id' => $plantId,
|
||||||
|
'scan_invoice' => $invoiceNo,
|
||||||
|
'total_sno_quantity' => 0,
|
||||||
|
'pending_quantity' => 0,
|
||||||
|
'scan_quantity' => 0
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$invoiceExists = LocatorInvoiceValidation::where('plant_id', $plantId)
|
||||||
|
->where('invoice_number', $invoiceNo)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if(!$invoiceExists)
|
||||||
|
{
|
||||||
|
Notification::make()
|
||||||
|
->title("Invoice number '$invoiceNo' does not exist in locator invoice table!")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
$this->dispatch('loadData', '', [], [], [], [], $plantId);
|
||||||
|
$this->form->fill([
|
||||||
|
'plant_id' => $plantId,
|
||||||
|
'scan_invoice' => $invoiceNo,
|
||||||
|
'total_sno_quantity' => 0,
|
||||||
|
'pending_quantity' => 0,
|
||||||
|
'scan_quantity' => 0
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$invoiceCompleted = LocatorInvoiceValidation::where('plant_id', $plantId)
|
||||||
|
->where('invoice_number', $invoiceNo)
|
||||||
|
->whereNull('scanned_status')
|
||||||
|
->orWhere('scanned_status', '=','')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if(!$invoiceCompleted)
|
||||||
|
{
|
||||||
|
$count = LocatorInvoiceValidation::where('invoice_number', $invoiceNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->count();
|
||||||
|
Notification::make()
|
||||||
|
->title("Invoice number '$invoiceNo' already completed the scanning process...")
|
||||||
|
->success()
|
||||||
|
->send();
|
||||||
|
$this->dispatch('loadData', '', [], [], [], [], $plantId);
|
||||||
|
|
||||||
|
$this->form->fill([
|
||||||
|
'plant_id' => $plantId,
|
||||||
|
'scan_invoice' => $invoiceNo,
|
||||||
|
'total_sno_quantity' => $count,
|
||||||
|
'pending_quantity' => 0,
|
||||||
|
'scan_quantity' => $count
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$serialNumbers = LocatorInvoiceValidation::where('plant_id', $plantId)
|
||||||
|
->where('invoice_number', $invoiceNo)
|
||||||
|
->pluck('serial_number');
|
||||||
|
|
||||||
|
$notFoundSerials = [];
|
||||||
|
$incompleteSerials = [];
|
||||||
|
$scannedSerials = [];
|
||||||
|
$foundSerials = [];
|
||||||
|
|
||||||
|
foreach ($serialNumbers as $serial)
|
||||||
|
{
|
||||||
|
$locatorRecord = LocatorInvoiceValidation::where('serial_number', $serial)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
//$scannedStatus = $locatorRecord->scanned_status ?? null;
|
||||||
|
|
||||||
|
if ($locatorRecord->scanned_status == 'Scanned')
|
||||||
|
{
|
||||||
|
$scannedSerials[] = $serial;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$palletRecord = palletValidation::where('serial_number', $serial)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (!$palletRecord)
|
||||||
|
{
|
||||||
|
$notFoundSerials[] = $serial;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$palletStatus = $palletRecord->pallet_status ?? null;
|
||||||
|
|
||||||
|
if (strlen($palletRecord->pallet_number) > 1 && ($palletStatus == '' || $palletStatus == null))
|
||||||
|
{
|
||||||
|
$incompleteSerials[] = $serial;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$foundSerials[] = $serial;
|
||||||
|
}
|
||||||
|
|
||||||
|
$count = LocatorInvoiceValidation::where('invoice_number', $invoiceNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$pendingCount = LocatorInvoiceValidation::where('invoice_number', $invoiceNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->whereNull('scanned_status')
|
||||||
|
->orWhere('scanned_status', '=', '')
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$scannedCount = LocatorInvoiceValidation::where('invoice_number', $invoiceNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->where('scanned_status', '=', 'Scanned')
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$this->form->fill([
|
||||||
|
'plant_id' => $plantId,
|
||||||
|
'scan_invoice' => $invoiceNo,
|
||||||
|
'total_sno_quantity' => $count,
|
||||||
|
'pending_quantity' => $pendingCount,
|
||||||
|
'scan_quantity' => $scannedCount,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->dispatch('loadData', $invoiceNo, $notFoundSerials, $incompleteSerials, $scannedSerials, $foundSerials, $plantId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function canAccess(): bool
|
||||||
|
{
|
||||||
|
return Auth::check() && Auth::user()->can('view invoice finder page');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
313
app/Livewire/InvoiceFinderDataTable.php
Normal file
313
app/Livewire/InvoiceFinderDataTable.php
Normal file
@@ -0,0 +1,313 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use App\Models\LocatorInvoiceValidation;
|
||||||
|
use App\Models\PalletValidation;
|
||||||
|
use Livewire\Component;
|
||||||
|
use Notification;
|
||||||
|
|
||||||
|
class InvoiceFinderDataTable extends Component
|
||||||
|
{
|
||||||
|
|
||||||
|
public $plantId;
|
||||||
|
|
||||||
|
public $invoiceNumber;
|
||||||
|
|
||||||
|
public $records = [];
|
||||||
|
|
||||||
|
protected $listeners = [
|
||||||
|
'loadData' => 'loadlocatorInvoiceData',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
public function loadlocatorInvoiceData($invoiceNumber, $notFoundSerials, $incompleteSerials, $scannedSerials, $foundSerials, $plantId)
|
||||||
|
{
|
||||||
|
$this->records = [];
|
||||||
|
|
||||||
|
if(count($notFoundSerials) > 0)
|
||||||
|
{
|
||||||
|
foreach($notFoundSerials as $serial)
|
||||||
|
{
|
||||||
|
$record = LocatorInvoiceValidation::where('serial_number', $serial)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$this->records[] = [
|
||||||
|
'created_at' => $record->created_at,
|
||||||
|
'created_by' => $record->created_by ?? '',
|
||||||
|
'serial_number' => $record->serial_number,
|
||||||
|
'pallet_number' => '',
|
||||||
|
'locator_number' => '',
|
||||||
|
'scanned_status' => 'Not Exist',
|
||||||
|
'scanned_at' => '',
|
||||||
|
'scanned_by' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count($incompleteSerials) > 0)
|
||||||
|
{
|
||||||
|
foreach($incompleteSerials as $serial)
|
||||||
|
{
|
||||||
|
$locatorRecord = LocatorInvoiceValidation::where('serial_number', $serial)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$palletRecord = palletValidation::where('serial_number', $serial)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$this->records[] = [
|
||||||
|
'created_at' => $locatorRecord->created_at,
|
||||||
|
'created_by' => $locatorRecord->created_by,
|
||||||
|
'serial_number' => $locatorRecord->serial_number,
|
||||||
|
'pallet_number' => $palletRecord->pallet_number,
|
||||||
|
'locator_number' => $palletRecord->locator_number,
|
||||||
|
'scanned_status' => 'Incompleted',
|
||||||
|
'scanned_at' => '',
|
||||||
|
'scanned_by' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count($foundSerials) > 1)
|
||||||
|
{
|
||||||
|
$foundPno = [];
|
||||||
|
$foundLno = [];
|
||||||
|
$foundSno = [];
|
||||||
|
$palletNo = '';
|
||||||
|
$locatorNo = '';
|
||||||
|
$palletSno = [];
|
||||||
|
$locatorSno = [];
|
||||||
|
foreach($foundSerials as $serial)
|
||||||
|
{
|
||||||
|
foreach($foundSerials as $sNo)
|
||||||
|
{
|
||||||
|
if (in_array($sNo, $foundSno))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$palletRecord = palletValidation::where('serial_number', $sNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->where('pallet_number', '!=','')
|
||||||
|
->where('pallet_number', '!=',null)
|
||||||
|
// ->whereNotNull('pallet_number')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if(!$palletRecord || ($palletNo && count($foundPno) > 0 && !in_array($palletRecord->pallet_number, $foundPno)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$palletNo = $palletRecord->pallet_number;
|
||||||
|
$locatorNo = $palletRecord->locator_number;
|
||||||
|
$foundSno[] = $sNo;
|
||||||
|
$foundPno[] = $palletRecord->pallet_number;
|
||||||
|
$palletSno[] = $sNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count($palletSno) > 1)
|
||||||
|
{
|
||||||
|
$locatorRecord = null;
|
||||||
|
|
||||||
|
foreach($palletSno as $mulSNo)
|
||||||
|
{
|
||||||
|
$locatorRecord = LocatorInvoiceValidation::where('serial_number', $mulSNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->records[] = [
|
||||||
|
'created_at' => $locatorRecord->created_at,
|
||||||
|
'created_by' => $locatorRecord->created_by,
|
||||||
|
'serial_number' => count($palletSno),
|
||||||
|
'pallet_number' => $palletNo,
|
||||||
|
'locator_number' => $locatorNo,
|
||||||
|
'scanned_status' => '',
|
||||||
|
'scanned_at' => '',
|
||||||
|
'scanned_by' => ''
|
||||||
|
];
|
||||||
|
|
||||||
|
$palletNo = '';
|
||||||
|
$locatorNo = '';
|
||||||
|
$palletSno = [];
|
||||||
|
}
|
||||||
|
else if(count($palletSno) == 1)
|
||||||
|
{
|
||||||
|
foreach($palletSno as $singleSNo)
|
||||||
|
{
|
||||||
|
$palletRecord = palletValidation::where('serial_number', $singleSNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->where('pallet_number', '!=','')
|
||||||
|
->whereNotNull('pallet_number')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$locatorRecord = LocatorInvoiceValidation::where('serial_number', $singleSNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
$this->records[] = [
|
||||||
|
'created_at' => $locatorRecord->created_at,
|
||||||
|
'created_by' => $locatorRecord->created_by,
|
||||||
|
'serial_number' => $locatorRecord->serial_number,
|
||||||
|
'pallet_number' => $palletRecord->pallet_number,
|
||||||
|
'locator_number' => $palletRecord->locator_number,
|
||||||
|
'scanned_status' => '',
|
||||||
|
'scanned_at' => '',
|
||||||
|
'scanned_by' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$palletNo = '';
|
||||||
|
$locatorNo = '';
|
||||||
|
$palletSno = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($serial, $foundSno))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$int = 0;
|
||||||
|
foreach($foundSerials as $locSNo)
|
||||||
|
{
|
||||||
|
if (in_array($locSNo, $foundSno))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$int++;
|
||||||
|
$locatorRecord = null;
|
||||||
|
$locatorRecord = palletValidation::where('serial_number', $locSNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->where('locator_number', '!=','')
|
||||||
|
->where('locator_number', '!=',null)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if(!$locatorRecord || ($locatorNo && count($foundLno) > 0 && !in_array($locatorRecord->locator_number, $foundLno)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$palletNo = $locatorRecord->pallet_number;
|
||||||
|
$locatorNo = $locatorRecord->locator_number;
|
||||||
|
$foundSno[] = $locSNo;
|
||||||
|
$foundLno[] = $locatorRecord->locator_number;
|
||||||
|
$locatorSno[] = $locSNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count($locatorSno) > 1)
|
||||||
|
{
|
||||||
|
$locatorRecord = null;
|
||||||
|
|
||||||
|
foreach($locatorSno as $mulSNo)
|
||||||
|
{
|
||||||
|
$locatorRecord = LocatorInvoiceValidation::where('serial_number', $mulSNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->records[] = [
|
||||||
|
'created_at' => $locatorRecord->created_at,
|
||||||
|
'created_by' => $locatorRecord->created_by,
|
||||||
|
'serial_number' => count($locatorSno),
|
||||||
|
'pallet_number' => $palletNo,
|
||||||
|
'locator_number' => $locatorNo,
|
||||||
|
'scanned_status' => '',
|
||||||
|
'scanned_at' => '',
|
||||||
|
'scanned_by' => ''
|
||||||
|
];
|
||||||
|
|
||||||
|
$palletNo = '';
|
||||||
|
$locatorNo = '';
|
||||||
|
$locatorSno = [];
|
||||||
|
}
|
||||||
|
else if(count($locatorSno) == 1)
|
||||||
|
{
|
||||||
|
foreach($locatorSno as $singleSNo)
|
||||||
|
{
|
||||||
|
$palletRecord = palletValidation::where('serial_number', $singleSNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->where('locator_number', '!=','')
|
||||||
|
->where('locator_number', '!=',null)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$locatorRecord = LocatorInvoiceValidation::where('serial_number', $singleSNo)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
$this->records[] = [
|
||||||
|
'created_at' => $locatorRecord->created_at,
|
||||||
|
'created_by' => $locatorRecord->created_by,
|
||||||
|
'serial_number' => $locatorRecord->serial_number,
|
||||||
|
'pallet_number' => $palletRecord->pallet_number,
|
||||||
|
'locator_number' => $palletRecord->locator_number,
|
||||||
|
'scanned_status' => '',
|
||||||
|
'scanned_at' => '',
|
||||||
|
'scanned_by' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$palletNo = '';
|
||||||
|
$locatorNo = '';
|
||||||
|
$locatorSno = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(count($foundSerials) == 1)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach($foundSerials as $serial)
|
||||||
|
{
|
||||||
|
|
||||||
|
$locatorRecord = LocatorInvoiceValidation::where('serial_number', $serial)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$palletRecord = palletValidation::where('serial_number', $serial)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$this->records[] = [
|
||||||
|
'created_at' => $locatorRecord->created_at,
|
||||||
|
'created_by' => $locatorRecord->created_by,
|
||||||
|
'serial_number' => $locatorRecord->serial_number,
|
||||||
|
'pallet_number' => $palletRecord->pallet_number,
|
||||||
|
'locator_number' => $palletRecord->locator_number,
|
||||||
|
'scanned_status' => '',
|
||||||
|
'scanned_at' => '',
|
||||||
|
'scanned_by' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count($scannedSerials) > 0)
|
||||||
|
{
|
||||||
|
foreach($scannedSerials as $serial)
|
||||||
|
{
|
||||||
|
$locatorRecord = LocatorInvoiceValidation::where('serial_number', $serial)
|
||||||
|
->where('plant_id', $plantId)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$this->records[] = [
|
||||||
|
'created_at' => $locatorRecord->created_at,
|
||||||
|
'created_by' => $locatorRecord->created_by,
|
||||||
|
'serial_number' => $locatorRecord->serial_number,
|
||||||
|
'pallet_number' => $locatorRecord->pallet_number,
|
||||||
|
'locator_number' => $locatorRecord->locator_number,
|
||||||
|
'scanned_status' => $locatorRecord->scanned_status,
|
||||||
|
'scanned_at' => $locatorRecord->scanned_at,
|
||||||
|
'scanned_by' => $locatorRecord->scanned_by
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.invoice-finder-data-table');
|
||||||
|
}
|
||||||
|
}
|
||||||
55
resources/views/livewire/invoice-finder-data-table.blade.php
Normal file
55
resources/views/livewire/invoice-finder-data-table.blade.php
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<div class="p-4">
|
||||||
|
<h2 class="text-lg font-bold mb-4 text-gray-700 uppercase tracking-wider">
|
||||||
|
INVOICE DATA STATUS TABLE:
|
||||||
|
</h2>
|
||||||
|
<div class="overflow-x-auto rounded-lg shadow">
|
||||||
|
<table class="w-full divide-y divide-gray-200 text-sm text-center">
|
||||||
|
<thead class="bg-gray-100 text-s font-semibold uppercase text-gray-700">
|
||||||
|
<tr>
|
||||||
|
<th class="border px-4 py-2">No</th>
|
||||||
|
<th class="border px-4 py-2">Created Datetime</th>
|
||||||
|
<th class="border px-4 py-2">Created By</th>
|
||||||
|
<th class="border px-4 py-2">Serial Number/Quantity</th>
|
||||||
|
<th class="border px-4 py-2">Pallet Number</th>
|
||||||
|
<th class="border px-4 py-2">Locator Number</th>
|
||||||
|
<th class="border px-4 py-2">Scanned Status</th>
|
||||||
|
<th class="border px-4 py-2">Scanned Datetime</th>
|
||||||
|
<th class="border px-4 py-2">Scanned By</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-100">
|
||||||
|
@forelse ($records as $index => $record)
|
||||||
|
<tr class="hover:bg-gray-50">
|
||||||
|
<td class="border px-4 py-2">{{ $index + 1 }}</td>
|
||||||
|
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['created_at'] ?? '' }}</td>
|
||||||
|
<td class="border px-4 py-2">{{ $record['created_by'] ?? '' }}</td>
|
||||||
|
<td class="border px-4 py-2">{{ $record['serial_number'] ?? '' }}</td>
|
||||||
|
<td class="border px-4 py-2">{{ $record['pallet_number'] ?? '' }}</td>
|
||||||
|
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['locator_number'] ?? '' }}</td>
|
||||||
|
<td class="border px-4 py-2">
|
||||||
|
@php
|
||||||
|
$status = $record['scanned_status'] ?? '';
|
||||||
|
@endphp
|
||||||
|
<span @class([
|
||||||
|
'text-green-600 font-semibold' => $status === 'Scanned',
|
||||||
|
'text-yellow-600 font-semibold' => $status === 'Incompleted',
|
||||||
|
'text-red-600 font-semibold' => $status === 'Not Exist',
|
||||||
|
])>
|
||||||
|
{{ $status }}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['scanned_at'] ?? '' }}</td>
|
||||||
|
<td class="border px-4 py-2">{{ $record['scanned_by'] ?? '' }}</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td colspan="9" class="px-4 py-4 text-center text-gray-500">
|
||||||
|
No records found.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
Reference in New Issue
Block a user