string currency
This commit is contained in:
@@ -127,19 +127,19 @@ class HoldingsTable extends DataTableComponent
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
Column::make(__('Average Cost Basis'), 'average_cost_basis')
|
Column::make(__('Average Cost Basis'), 'average_cost_basis')
|
||||||
->sortable()
|
->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')
|
Column::make(__('Total Cost Basis'), 'total_cost_basis')
|
||||||
->sortable()
|
->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')
|
Column::make(__('Market Value'), 'market_data.market_value')
|
||||||
->sortable()
|
->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'))
|
Column::make(__('Total Market Value'))
|
||||||
->sortable(fn (Builder $query, string $direction) => $query->orderBy('total_market_value', $direction))
|
->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'))
|
Column::make(__('Market Gain/Loss'))
|
||||||
->html()
|
->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,
|
'costBasis' => $row->average_cost_basis,
|
||||||
'marketValue' => $row->market_data->market_value,
|
'marketValue' => $row->market_data->market_value,
|
||||||
'small' => true,
|
'small' => true,
|
||||||
@@ -147,17 +147,17 @@ class HoldingsTable extends DataTableComponent
|
|||||||
->sortable(fn (Builder $query, string $direction) => $query->orderBy('market_gain_dollars', $direction)),
|
->sortable(fn (Builder $query, string $direction) => $query->orderBy('market_gain_dollars', $direction)),
|
||||||
Column::make(__('Realized Gain/Loss'), 'realized_gain_dollars')
|
Column::make(__('Realized Gain/Loss'), 'realized_gain_dollars')
|
||||||
->sortable()
|
->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) ),
|
->format(fn($value, $row) => Number::currency($value ?? 0, $row->market_data?->currency ?? '') ),
|
||||||
Column::make(__('Dividends Earned'), 'dividends_earned')
|
Column::make(__('Dividends Earned'), 'dividends_earned')
|
||||||
->sortable()
|
->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')
|
Column::make(__('52 week low'), 'market_data.fifty_two_week_low')
|
||||||
->sortable()
|
->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')
|
Column::make(__('52 week high'), 'market_data.fifty_two_week_high')
|
||||||
->sortable()
|
->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'))
|
Column::make(__('Number of Transactions'))
|
||||||
->sortable(fn (Builder $query, string $direction) => $query->orderBy('num_transactions', $direction))
|
->sortable(fn (Builder $query, string $direction) => $query->orderBy('num_transactions', $direction))
|
||||||
->label(fn ($row) => $row->num_transactions),
|
->label(fn ($row) => $row->num_transactions),
|
||||||
|
|||||||
Reference in New Issue
Block a user