mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Fix Plaid cash balance double counting (#2222)
* Fix Plaid cash balance double counting * Fix today's cash balance * Simplify balance trends in activity view
This commit is contained in:
parent
42207e487e
commit
1e5edd9f2f
8 changed files with 72 additions and 97 deletions
|
@ -21,7 +21,13 @@ class Balance::ReverseCalculator < Balance::BaseCalculator
|
|||
if valuation.present?
|
||||
@balances << build_balance(date, previous_cash_balance, holdings_value)
|
||||
else
|
||||
@balances << build_balance(date, current_cash_balance, holdings_value)
|
||||
# If date is today, we don't distinguish cash vs. total since provider's are inconsistent with treatment
|
||||
# of the cash component. Instead, just set the balance equal to the "total value" reported by the provider
|
||||
if date == Date.current
|
||||
@balances << build_balance(date, account.cash_balance, account.balance - account.cash_balance)
|
||||
else
|
||||
@balances << build_balance(date, current_cash_balance, holdings_value)
|
||||
end
|
||||
end
|
||||
|
||||
current_cash_balance = previous_cash_balance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue