New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Total balance is incorrect for one of my accounts #506
Comments
What version of the software are you using? |
I'm using 2.0.7. For the entry of the transactions, I have done both. Some were entered on the EUR side, some on the BGN side. Proportionally the large majority have been entered on the BGN side. The UI for entering conversion rates is not 100% reliable. The currency conversion needs to be entered in a modal dialog, but this does not appear consistently. For example it does not appear when editing a value which on a transaction which had already been saved. It is possible something went wrong here. What is also a likely cause is that for some transactions I had corrected these values on both sides in earlier versions of the app, back when it was not possible to enter the exact currency conversion value because there were not enough significant digits. |
Is there anything I can do to help debug this? |
@pfrenssen I will let you know if we do. I've just not had the time to look at this. |
@codinguser Yes, sure, I'll have a look. |
I've been testing these days and, while I've found some small issues, like the opening of the conversion dialog you mention, so far I haven't been able to reproduce the balance issue. Maybe knowing this would help:
|
@rivaldi8, can you tell me where the data files are located? |
The data is under
|
@rivaldi8 thanks! I will export the data and e-mail it to you. Just to confirm, does your e-mail address start with 'rivladi8' or 'rivaldi8'? |
Sorry, I mistyped it. It's 'rivaldi8'. |
@rivaldi8, thanks, I have sent you the exported data. |
Finally I've found what's going on. The source of the problem is the transaction that appears with an amount of 330.93 BGN (25th may). Let's add some context first (@codinguser please, correct me if I'm wrong). A transaction is always represented by two splits (assuming no manually entered splits). Both have the same amount but with different sign. One belongs to the account of the transaction. The other to the transfer account. Also, each split stores two amounts: "quantity" and "value".
For example, a transaction introduced in account
where If
Then, in the problematic transaction, which is between accounts with the same currency, we have something like this:
The reason the numbers don't add up is that the transactions list uses (in this case --same currency) I've tried to create a transaction with the same inconsistency, but I've haven't succeeded. @pfrenssen do you remember what did you do with this transaction? It looks as if previously it had an account with different currency and then, it was edited somehow producing this inconsistency. |
I don't remember what I did, but I see that this transaction is for a flight which I paid with my company account, where usually I pay all my flights with my VISA account. It is possible I first entered this transaction for my VISA account (which is in EUR), and then changed it to my company account (which is in BGN). If the resulting value is around half of the original value then this seems consistent with this, 1 EUR = 1.95583 BGN. It was around the 25th of May indeed that I started noticing that my account total was wrong. When I filed the bug report I already had the problem for a few days but thought I made a mistake when entering data. On the 28th I verified all individual transactions by hand and compared them to my bank account and realized I was dealing with a bug. |
Ok, thanks for the information. I'll keep trying to reproduce de bug. By the way, I forgot to say that you should be able to fix the balance of this account by removing this transaction and entering it again. |
Thanks! |
Steps to reproduce:
"Account-BGN 2" account will be listed with a balance of -5 BGN. However, if opened, the transaction will be listed with an amount of -10 BGN. I'll work on a fix. |
That's great news, really glad that you can replicate the problem. Thanks very much for your time! |
thanks @rivaldi8 |
…sfer funds dialog. Fixes codinguser#506
So I have been trying some ways to reproduce this bug. This is what I'm doing, starting from empty database:
Caveat 1*8. Open Acct-EUR and press 'Edit' icon on the transaction Caveat 2*8. Open Acct-BGN1 and press 'Edit' icon on the transaction The two caveats are bugs in themselves, but are not the exact some bug in this issue. @rivaldi8 I am having trouble replicating the bug where the transaction total and the account total mismatch. I know I succeeded in replicating it once. But now it's gone. Step 3 in your comment does not occur for me (i.e. the TF dialog doesn't open). I just switch the account from Acct-EUR to Acct-BGN2 and save. Then both splits show 10 BGN (as they should). Could you help me complete the steps above in detail to produce a path which shows the error? Thanks |
Ok, all is correct up to step 7, but there's a mistake in 8. Also, I defined the steps for the 2.0.7 but I guess you are on develop, then there's an additional step: *8. Open Acct-BGN1 (not Acct-EUR), and press the 'Edit' icon on the transaction I can also reproduce the caveats. Do you want me to work on fixing them? |
Test that opening a multi-currency transaction and saving it again should not modify the transaction Test that opening a multicurrency transaction and then changing it to be no longer multi-currency should maintain consistent amount for the split value and quantity Fix getImbalance() method of transactions to ignore multicurrency transactions.
…ause inconsistency in the split value and quantity Splits now implement Parcelable - easing passing of data between TransactionForm and SplitEditor Update the transaction UID of all splits whenever the UID of a transaction is set Add tests for multi-currency transaction creation and editing - fixes #506 - closes #524
2d76e1f alone does not seem to fix it. I managed to simplify the code for saving transactions and fix the problem in the process. I have uploaded it to the branch Please check it out let me know if stuff works for you. I'll merge sometime tomorrow into develop |
I've done some testing and it seems to be working properly now. Save for some small non-important issues (I'll add some inline comments), the changes seem sensible (by the way, great work with saveNewTransaction! :) |
For one of my accounts the total balance is not correct. At the moment the total balance should be 1656.01BGN but the total balance shown is 1714.77BGN. There are no future transactions. I actually went through all transactions and calculated them by hand and came up with the exact same number as is shown in my actual bank account: 1656.01BGN.
I'm managing 9 accounts but this seems to be the only one exhibiting the problem. What is special about this account is that it is in BGN, but it contains several transactions that are done between this account and a couple of my other accounts which are in EUR. Possibly something has gone wrong in the currency conversion.
I'm willing to privately share a backup of my data files if this could help in debugging the problem.
The text was updated successfully, but these errors were encountered: