Skip to content
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

New transaction is not saved correctly (sign issue) #723

Closed
cmburg opened this issue Sep 4, 2017 · 17 comments
Closed

New transaction is not saved correctly (sign issue) #723

cmburg opened this issue Sep 4, 2017 · 17 comments
Assignees
Labels
Milestone

Comments

@cmburg
Copy link

cmburg commented Sep 4, 2017

Steps to reproduce the behaviour

  1. In an account (type bank) add a new transaction using the orange button.
  2. type any amount you like (eg 10000 as deposit, the sign changes and the number becomes red)
  3. Choose an account which has the type "expense"
  4. Save
  5. Go back to the account overview.

Expected behaviour

The amount has been substracted.

Actual behaviour

The amount has been added.

Funfact: It seems to work correct when hitting "split" after step 3. and then hitting "save" twice
It occurred with the last update on google-play a few days ago. No issues in previous version.

Software specifications

  • GnuCash Android version:2.2.1
  • System Android version:7.1.2
  • Device type:Nexus 5X
@rivaldi8
Copy link
Collaborator

rivaldi8 commented Sep 4, 2017

@cmburg In step 2, is the switch next to the amount in green, with the text Deposit, and it changes to red Withdrawal when you start typing the amount?

Have you changed the setting Default Transaction Type in Settings > Transactions? What's its value?

When you say:

It seems to work correct when hitting "split" after step 4. and then hitting "save" twice

Do you really mean before step 4? Or you mean you edit the transaction again and hit split?

It's strange because in my tests I always see the same behaviour: transactions entered from a bank account increase the account's balance by default. I've gone back until 2.1.6 and the behaviour is the same. It doesn't seem to have changed in a long time, so I don't know why it has changed for you (and you're not the only one :).

@rivaldi8 rivaldi8 self-assigned this Sep 4, 2017
@rivaldi8 rivaldi8 added the bug label Sep 4, 2017
@nicolelexo
Copy link

Hi, I've been having this problem too. I use a Xiaomi Mi Max. The switch does not change when I am typing the amount, the transactions I enter increase account balance regardless of whether it is a receive/spend transaction. This issue seems to have cropped up with the last update, at least for me.

@nicolelexo
Copy link

As for settings, my default transaction type is Debit, when I changed it to Credit and did a spend transaction it deducts from account balance as expected. Is that the solution? What changed?

@codinguser
Copy link
Owner

@cmburg @nicolelexo we are trying to locate the problem and fix it. The first step is to replicate the problem, which I haven't managed to do so far. It would be great if you could provide us the following info:

  • Are you using double-entry accounting? (Settings --> Transactions --> Activate Double Entry)
  • What are the types of the accounts you are using when you see the issue (I am not able to reproduce it with BANK and EXPENSE type accounts as described by @cmburg )
  • Does it happen when creating new transactions or when editing old ones?
  • Does the problem occur when you use the split editor to edit the splits?
  • Do you have any issues with the account balances of existing accounts with old transactions?
  • Do you regularly import from /export to GnuCash desktop?

@mutedbytes
Copy link

@codinguser I invite you to also see my report/details in #726

@codinguser
Copy link
Owner

@mutedbytes I saw your post, I followed the steps as best as I understood them and could not reproduce the problem.
I created a transaction in a new ASSET account, with the "Decrease" transaction type. The transfer account is EXPENSE. This added a negative sign to the amount value and shows it in red. When I save it, the balance of the account decreases as expected. I've tried switching the default transaction type, but no unexpected effect was observed.

@rivaldi8 As I am using a new installation of the app, I have a feeling that this issue depends on some pre-existing transactions in the account. So we have to figure out what all those affected by this have in common.

@codinguser codinguser added this to the v2.2.2 milestone Sep 7, 2017
@cmburg
Copy link
Author

cmburg commented Sep 7, 2017

@rivaldi8

In step 2, is the switch next to the amount in green, with the text Deposit, and it changes to red Withdrawal when you start typing the amount?

At first both the number and the text is green and changes red when hitting withdrawal.

Have you changed the setting Default Transaction Type in Settings > Transactions?

No.

What's its value?

It's in German 'Haben' but it's 'credit' in English. When I hit the button to change its value both radio buttons are empty/ not set.

Do you really mean before step 4?

Yes, my fault. I meant after 3 / before 4.

Or you mean you edit the transaction again and hit split?

Tapping 'edit', split, save twice corrects the wrong transaction.

@codinguser

Are you using double-entry accounting? (Settings --> Transactions --> Activate Double Entry)

Yes.

What are the types of the accounts you are using when you see the issue (I am not able to reproduce it with BANK and EXPENSE type accounts as described by @cmburg )

A quick test with two accounts (asset/ bank) reproduces it.

Does it happen when creating new transactions or when editing old ones?

Both.

Does the problem occur when you use the split editor to edit the splits?

No.

Do you have any issues with the account balances of existing accounts with old transactions?

Unsure since I deleted all and entered them again.

Do you regularly import from /export to GnuCash desktop?

No. I only export.

@rivaldi8
Copy link
Collaborator

rivaldi8 commented Sep 7, 2017

@rivaldi8 As I am using a new installation of the app, I have a feeling that this issue depends on some pre-existing transactions in the account. So we have to figure out what all those affected by this have in common.

@codinguser Yes, I also thought I could depend on previous data, so I spent some time testing. Install a 2.2.0 version (pre-2353957), add some transactions, update to 2.2.1, add some transactions again and compare the results.

In the UI I always get the bank account balance increased. In the database all seems correct in the splits table. All amounts are positive and with the correct type (debit/credit).

I get the same following @mutedbytes's steps. No difference changing the default transaction type.

@nicolelexo
Copy link

nicolelexo commented Sep 7, 2017

@codinguser

Are you using double-entry accounting? (Settings --> Transactions --> Activate Double Entry)

Yes I am, I changed to Default --> Credit and it seems to have resolved itself, unless I key in old transactions (predictive) then it reverts to the same double negative problem.

What are the types of the accounts you are using when you see the issue (I am not able to reproduce it with BANK and EXPENSE type accounts as described by @cmburg )

I am using an Asset account I named Cash In Wallet and an Expense account Dining, I have not noticed any problems with other account types as I haven't really been spending on things other than food. Post switch from Debit to Credit default (see previous question) there has been no problem with a Liability Credit Card/Expense Petrol charge transaction.

Does it happen when creating new transactions or when editing old ones?

It happened when creating new transactions in Debit default mode, after switching the Credit default mode and trying to create a copy of an old pre switch transaction (predictive input feature) it also happens.

Does the problem occur when you use the split editor to edit the splits?

Haven't had the chance to use this as I don't usually split my transactions.

Do you have any issues with the account balances of existing accounts with old transactions?

Nope, only transactions after the most recent update.

Do you regularly import from /export to GnuCash desktop?

I used to, but now no.

@mutedbytes
Copy link

@codinguser Specifically, I see the bug occur when editing one of these transactions.

@jaalzateolaya
Copy link

Same problem here. It starts happening like four weeks ago in my device. At least then I realized my account balance was wrong.

Splitting the transaction, switching twice the direction and saving fixes the problem.

It affects the same way with new transactions and editing old ones.

@rivaldi8
Copy link
Collaborator

I still haven't been able to reproduce the issue, nor have I found what might be the cause. It would help if you could answer these questions. Thanks!

  • Can you reproduce the issue from a new book (menu button > books drop-down > Manage books... > "+" button)? If you can, please, export it to XML and attach it here.
  • What language are you using in your device?
  • What's the main currency you are using in GnuCash? Do you use other currencies?

@cmburg
Copy link
Author

cmburg commented Sep 19, 2017

Can you reproduce the issue from a new book (menu button > books drop-down > Manage books... > "+" button)? If you can, please, export it to XML and attach it here.

No.

What language are you using in your device?

German

What's the main currency you are using in GnuCash? Do you use other currencies?

Just euro

@rivaldi8
Copy link
Collaborator

rivaldi8 commented Oct 3, 2017

I've done all kinds of tests with no luck reproducing the issue, which makes it quite hard to find the cause. I've also spent some time reviewing all code paths I could think of and all related changes since the last version, but I couldn't find anything wrong.

So, before I give you some APKs to test, I'd like you to do a last test to discard a possible UI refresh issue:

  1. Follow whatever steps you do to reproduce the issue. All of you seem to end up with the account listed with a wrong balance. This is what I want you to check.
  2. Change the name of the account that has the wrong balance:
    1. From the account list, press the account's menu (three vertical dots), then Edit Account.
    2. Change the account name.
    3. Press SAVE.
  3. The account list will show again with the new name. Check here whether the balance is still wrong or has it changed.

If this doesn't make any difference, try killing the application and opening it again. To do so, press the Android square button to show all your opened applications, then press the cross (x) in GnuCash.

Thanks for your help!

@jaalzateolaya
Copy link

I tried changing the account name but it does not fix the wrong balance. The only way, as said before is splitting and switching the transaction type twice.

@rivaldi8
Copy link
Collaborator

rivaldi8 commented Oct 6, 2017

Sorry, big mistake from my part. Finally I could spend some calm time looking into it. Then I noticed that the branch from were I was testing included commits that weren't in master, as I had assumed. These commits fixed the problem.

It seems the issue was introduced in 957ae86. 4c7c241 fixes it but, as they are related, I would also include f490f9f and 07a1470. @codinguser could you please verify it and cherry-pick the commits?

@jcos1
Copy link

jcos1 commented Nov 8, 2017

My cash account balance was messed up and I didn't know which transaction caused it.
I removed all '-' signs from the withdrawals (in the edit transaction screen).
Now the account balance is OK again.

Waiting for a new release...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants