1
0
forked from poc/pds

Added Row Number on report

This commit is contained in:
dhanabalan
2025-05-31 10:37:18 +05:30
parent ce80f8e7e5
commit 58f98c7632

View File

@@ -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()