mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Show cash + holdings value for investment account view (#1046)
* Handle missing tickers in security price syncs * Show combined cash and holdings value on account page * Improve partial locals
This commit is contained in:
parent
453a54e5e6
commit
ea8309eedd
20 changed files with 168 additions and 33 deletions
13
app/helpers/account/cashes_helper.rb
Normal file
13
app/helpers/account/cashes_helper.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
module Account::CashesHelper
|
||||
def brokerage_cash(account)
|
||||
currency = Money::Currency.new(account.currency)
|
||||
|
||||
account.holdings.build \
|
||||
date: Date.current,
|
||||
qty: account.balance,
|
||||
price: 1,
|
||||
amount: account.balance,
|
||||
currency: account.currency,
|
||||
security: Security.new(ticker: currency.iso_code, name: currency.name)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue