F
Filament2mo ago
Eren

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())
])
It show same summarize twice. both is correct but i didnt understand why its duplicate same results. this page also shows all reservations results. also all reservations show this page results.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server