Feat: Adds multi currency support (#88)

This commit is contained in:
hackerESQ
2025-04-09 19:25:15 -05:00
committed by GitHub
parent 6d6f968f42
commit eae345f243
100 changed files with 17735 additions and 35761 deletions
@@ -0,0 +1,41 @@
<?php
use App\Models\Holding;
use Livewire\Volt\Component;
new class extends Component
{
// props
public Holding $holding;
protected $listeners = [
'transaction-updated' => '$refresh',
'transaction-saved' => '$refresh',
];
// methods
}; ?>
<div>
@foreach ($holding->dividends->take(5) as $dividend)
<x-list-item :item="$dividend">
<x-slot:value>
@php
$owned = ($dividend->purchased - $dividend->sold);
@endphp
{{ Number::currency($dividend->dividend_amount, $holding->market_data->currency) }}
x {{ $owned }}
= {{ Number::currency($owned * $dividend->dividend_amount, $holding->market_data->currency) }}
</x-slot:value>
<x-slot:sub-value>
<span title="{{ __('Ex Dividend Date') }}">{{ $dividend->date->format('F d, Y') }}</span>
</x-slot:sub-value>
</x-list-item>
@endforeach
</div>