mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-22 06:39:39 +02:00
* Handle missing tickers in security price syncs * Show combined cash and holdings value on account page * Improve partial locals
13 lines
364 B
Ruby
13 lines
364 B
Ruby
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
|