public static function table(Table $table): Table
{
return $table
->groups([
Tables\Grouping\Group::make('boxTemplate.id')
->label('Šablonas'),
Tables\Grouping\Group::make('confirmed')
->label('Aktyvi'),
])
//->defaultGroup('boxTemplate.id')
->columns([
Tables\Columns\Layout\Split::make([
Tables\Columns\TextColumn::make('boxTemplate.name')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall)
->description(function ($record) { return 'ID: '.$record->boxTemplate->id ?? ''; })
->label('Šablonas'),
Tables\Columns\TextColumn::make('company.name')
->label('Įmonė'),
Tables\Columns\Layout\Stack::make([
Tables\Columns\TextColumn::make('invoice_number')
->label('Sąskaitos numeris')
->searchable(),
Tables\Columns\TextColumn::make('date')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall)
->label('Sąskaitos data')
->date('Y-m-d')
->searchable(),
]),
Tables\Columns\Layout\Stack::make([
Tables\Columns\TextColumn::make('boxTemplateList.boxTemplateCategory.name')
->label('Pakuotė')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall),
Tables\Columns\TextColumn::make('boxTemplateList.gpais.name')
->label('Gpais kodas')
->size(Tables\Columns\TextColumn\TextColumnSize::ExtraSmall),
]),
->formatStateUsing(fn (string $state, $record) => number_format($record->amount / $state, 0) ),
Tables\Columns\ToggleColumn::make('confirmed')
->label('Aktyvi'),
])
])