Duplicate summarizer
TextColumn::make('total')
->label('Total')
->getStateUsing(fn ($record) => $this->cacheCalculations($record)['total'])
->money(fn ($record) => $this->cacheCalculations($record)['currency'])
->summarize([
\Filament\Tables\Columns\Summarizers\Summarizer::make()
->label('This page')
->using(function () {
return $this->getTableRecords()
->map(fn ($record) => $this->cacheCalculations($record)['total'])
->sum();
})
->money(fn () => $this->getCurrencyFromTourSupplier()),
\Filament\Tables\Columns\Summarizers\Summarizer::make()
->label('All reservations')
->using(function () {
return $this->getTableQuery()
->get()
->map(fn ($record) => $this->cacheCalculations($record)['total'])
->sum();
})
->money(fn () => $this->getCurrencyFromTourSupplier())
])
TextColumn::make('total')
->label('Total')
->getStateUsing(fn ($record) => $this->cacheCalculations($record)['total'])
->money(fn ($record) => $this->cacheCalculations($record)['currency'])
->summarize([
\Filament\Tables\Columns\Summarizers\Summarizer::make()
->label('This page')
->using(function () {
return $this->getTableRecords()
->map(fn ($record) => $this->cacheCalculations($record)['total'])
->sum();
})
->money(fn () => $this->getCurrencyFromTourSupplier()),
\Filament\Tables\Columns\Summarizers\Summarizer::make()
->label('All reservations')
->using(function () {
return $this->getTableQuery()
->get()
->map(fn ($record) => $this->cacheCalculations($record)['total'])
->sum();
})
->money(fn () => $this->getCurrencyFromTourSupplier())
])
0 Replies