This commit is contained in:
hackerESQ
2025-09-26 20:03:39 -05:00
parent 5b8b9ae39e
commit a10f94a570
+9 -10
View File
@@ -127,19 +127,19 @@ class HoldingsTable extends DataTableComponent
->sortable(),
Column::make(__('Average Cost Basis'), 'average_cost_basis')
->sortable()
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') ),
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency) ),
Column::make(__('Total Cost Basis'), 'total_cost_basis')
->sortable()
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') ),
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency) ),
Column::make(__('Market Value'), 'market_data.market_value')
->sortable()
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') ),
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency) ),
Column::make(__('Total Market Value'))
->sortable(fn (Builder $query, string $direction) => $query->orderBy('total_market_value', $direction))
->label(fn ($row) => Number::currency($row->total_market_value ?? 0, $row->market_data?->currency ?? '')),
->label(fn ($row) => Number::currency($row->total_market_value ?? 0, $row->market_data?->currency)),
Column::make(__('Market Gain/Loss'))
->html()
->label(fn($row) => Number::currency($row->market_gain_dollars ?? 0, $row->market_data?->currency ?? '') . view('components.ui.gain-loss-arrow-badge', [
->label(fn($row) => Number::currency($row->market_gain_dollars ?? 0, $row->market_data?->currency) . view('components.ui.gain-loss-arrow-badge', [
'costBasis' => $row->average_cost_basis,
'marketValue' => $row->market_data?->market_value,
'small' => true,
@@ -147,17 +147,16 @@ class HoldingsTable extends DataTableComponent
->sortable(fn (Builder $query, string $direction) => $query->orderBy('market_gain_dollars', $direction)),
Column::make(__('Realized Gain/Loss'), 'realized_gain_dollars')
->sortable()
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') )
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') ),
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency) ),
Column::make(__('Dividends Earned'), 'dividends_earned')
->sortable()
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') ),
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency) ),
Column::make(__('52 week low'), 'market_data.fifty_two_week_low')
->sortable()
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') ),
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency) ),
Column::make(__('52 week high'), 'market_data.fifty_two_week_high')
->sortable()
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') ),
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency) ),
Column::make(__('Number of Transactions'))
->sortable(fn (Builder $query, string $direction) => $query->orderBy('num_transactions', $direction))
->label(fn ($row) => $row->num_transactions),