1
0
Fork 0
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)
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

* Fix Plaid cash balance double counting

* Fix today's cash balance

* Simplify balance trends in activity view
This commit is contained in:
Zach Gollwitzer 2025-05-08 12:25:53 -04:00 committed by GitHub
parent 42207e487e
commit 1e5edd9f2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 72 additions and 97 deletions

View file

@ -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