actualbudget / actual

A local-first personal finance app
https://actualbudget.org
MIT License
15.6k stars 1.21k forks source link

[Bug]: Hide reconciled transactions - wrong balance shown #2703

Closed ngocphamm closed 1 month ago

ngocphamm commented 6 months ago

Verified issue does not already exist?

What happened?

Balance on the account is shown differently when reconciled transactions are hidden.

Not hidden

CleanShot 2024-05-04 at 10 27 15

Hidden

CleanShot 2024-05-04 at 10 27 36

I think another person experienced this too https://github.com/actualbudget/actual/issues/2503#issuecomment-2094151378

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Firefox

Operating System

Mac OSX

ToniCipriani commented 6 months ago

Issue confirmed on Windows and Android PWA as well.

MatissJanis commented 6 months ago

👋 Would you mind providing a demo budget export so folks can reproduce the issue? Thanks

ngocphamm commented 6 months ago

@MatissJanis Please use this one.

2024-05-06-My-Finances-2befb2e.zip

joel-jeremy commented 6 months ago

The issue occurs because the running balance calculation runs the calculations based on the queried transactions. In the case of hiding the reconciled transaction, the reconciled transaction are being excluded from the query hence the calculation is returning the wrong results.

I can think of two possible ways to fix this:

  1. Revert the query to fetch all transactions (including reconciled) but do not render the reconciled transactions.
  2. When toggling the reconciled transactions, recalculate the starting balance in which the running balance calculation will start from.
youngcw commented 6 months ago

The issue occurs because the running balance calculation runs the calculations based on the queried transactions. In the case of hiding the reconciled transaction, the reconciled transaction are being excluded from the query hence the calculation is returning the wrong results.

I can think of two possible ways to fix this:

  1. Revert the query to fetch all transactions (including reconciled) but do not render the reconciled transactions.
  2. When toggling the reconciled transactions, recalculate the starting balance in which the running balance calculation will start from.

I think either of those would work. The one small thing with option 1 is that the transactions may not be contiguous and that would make the running balance not align perfectly with the shown transactions. Option 2 would get around this, but could be annoying to users who would like both.

atgrey24 commented 4 months ago

I think either of those would work. The one small thing with option 1 is that the transactions may not be contiguous and that would make the running balance not align perfectly with the shown transactions. Option 2 would get around this, but could be annoying to users who would like both.

I think it's ok if the running balance is not contiguous, so long as it's accurate to what the balance was at time of the transaction. It sounds like option 1 would give this result.