maybe-finance / maybe

The OS for your personal finances
https://maybe.co
GNU Affero General Public License v3.0
30.91k stars 2.3k forks source link

Bug: Day transactions inferior to 1 are not subtracted in depository balance #1248

Open Norin-Radd opened 1 week ago

Norin-Radd commented 1 week ago

Describe the bug transactions amount of a specific day are not subtracted from the balance

To Reproduce transaction amount of the day is less than 1 euro, it´s -0,64€, has can be seen on screenshots from day 22 to 23, the balance is the same.

Expected behavior I would expect the amount referred would be subtracted from the current balance

Screenshots / Recordings

image

image image

Additional context I am on latest commit, compose file was pulled and built today accordingly to maybe wiki instructions

zachgoll commented 1 week ago

@Norin-Radd what is the balance for Sep 24th? Is it 0.64 less?

Norin-Radd commented 1 week ago

No, it was not subtracted, so it's 0.64€ more.

zachgoll commented 1 week ago

@Norin-Radd sorry, not sure I follow you here. The graph you show indicates a lower balance for Sep 24. Can you confirm that these are the balances that you are seeing?

Our system currently reports start of day balance, so in this case, the start of day balance on Sep 23 was 140,97. During that day, -0.64 flowed out of the account, which would make the next day's start balance 140,33 (0.64 lower as a result of the outflows).

If those are not the numbers you're seeing let me know.

The reason we calculate start of day balance is because we work backwards from the current balance on the account and calculate the net flows each day. We can't always guarantee that the user provides an origin value of the entire account, so working backwards is the only way to calculate these historicals reliably.

Norin-Radd commented 1 week ago

Hello,

What I might see is the balance shown in the line graph of the present day which is the balance of the previous day subtracted or added with the transaction of that present day.

image

image

image

I don´t have any transaction on day 22, or if I had I have changed the date to day 21 on the transaction.

image image

sorry for the messy reply:

this Sep 22 is 140,97 should not appear on the line graph, maybe that's what's causing the bug.

I went backward and found the bug on those specific days, the issue might be caused by edited transaction dates. I have another on day 20 that was edited to day 19 and it is showing in the graph as 0€ transaction on day 20 (which does not exist), surprisingly it subtracted the 20€ of day 21, just the day 23 with the 0.64€ transaction was not subtracted, day 22 transaction with 0€ does not exist also.

zachgoll commented 1 week ago

@Norin-Radd before we dig too far into this, would you mind hitting the "sync" button on this account so we can rule out any out-of-sync data here?

If we still have the error after that there may be a bug here.

Norin-Radd commented 1 week ago

I have pressed sync lots of times and I have even deleted and imported back the day 23 transactions.

zachgoll commented 1 week ago

@Norin-Radd got it. This is a bit challenging for me to follow. Would you mind providing me a table of your balances and transactions for the following dates: Sep 22, Sep 23, Sep 24

Date Expected Balance Actual Balance

and

Date Transaction amount
Norin-Radd commented 6 days ago

Hello, my explanation was a real mess. I hope this makes it easy for you. Sync did not work today also after docker restart.

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

Date | Transaction amount | Expected Balance | Actual Balance | transaction -- | -- | -- | -- | -- 21/09/2024 | -20 | 140.97 | 140.97 | exist 22/09/2024 | 0 | 140.97 | 140.97 | should not exist (transaction date from day 22 changed after import to day 21) 23/09/2024 | -0.64 | 140.33 | 140.97 | exist 24/09/2024 | -116.18 | 24.15 | 24.79 | exist

zachgoll commented 5 days ago

@Norin-Radd thanks for the table! This helps a lot. Will take a look into this sync behavior.