Added Row Number on report
This commit is contained in:
@@ -58,7 +58,6 @@ class InvoiceValidationResource extends Resource
|
|||||||
|
|
||||||
Section::make('')
|
Section::make('')
|
||||||
->schema([
|
->schema([
|
||||||
|
|
||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
->required()
|
->required()
|
||||||
@@ -198,10 +197,18 @@ class InvoiceValidationResource extends Resource
|
|||||||
return $table
|
return $table
|
||||||
->query(InvoiceValidation::query())
|
->query(InvoiceValidation::query())
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('id')
|
// Tables\Columns\TextColumn::make('id')
|
||||||
->label('ID')
|
// ->label('ID')
|
||||||
->numeric()
|
// ->numeric()
|
||||||
->sortable(),
|
// ->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('No.')
|
||||||
|
->label('No.')
|
||||||
|
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
||||||
|
$paginator = $livewire->getTableRecords();
|
||||||
|
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||||
|
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||||
|
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||||
|
}),
|
||||||
Tables\Columns\TextColumn::make('invoice_number')
|
Tables\Columns\TextColumn::make('invoice_number')
|
||||||
->label('Invoice Number')
|
->label('Invoice Number')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
Reference in New Issue
Block a user