mirror of
https://github.com/we-promise/sure.git
synced 2026-04-14 01:24:06 +00:00
* Handle missing tickers in security price syncs * Show combined cash and holdings value on account page * Improve partial locals
14 lines
364 B
Ruby
14 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
|