F
Filament13mo ago
Bloom

Custom query in summaries

->columns([
TextColumn::make('mainStock.item.item_name'),
TextColumn::make('quantity'),
TextColumn::make('cost_price')
->label('Cost Price'),
TextColumn::make('mrp')
->summarize(Summarizer::make()
->label('Total')
->using(fn (Builder $query): string => $query->sum('mrp'))),
])
->columns([
TextColumn::make('mainStock.item.item_name'),
TextColumn::make('quantity'),
TextColumn::make('cost_price')
->label('Cost Price'),
TextColumn::make('mrp')
->summarize(Summarizer::make()
->label('Total')
->using(fn (Builder $query): string => $query->sum('mrp'))),
])
Instad of just getting the sum i want to display a sum of mrp multiplied by each quantity
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server