codinguser / gnucash-android

Gnucash for Android mobile companion application.
Apache License 2.0
1.23k stars 539 forks source link

[BUG] linebreak destroys qif format #891

Open nottheend opened 4 years ago

nottheend commented 4 years ago

Have had an entry of a transaction where I copied some text over and pasted it in the description field.

It was not shown in Gnucash App, but it turned out that there was a linebreak included.

Once I exported a qif file I was unable to import it to Gnucash.

After debugging the qif file I figured out: the linebreak was printed in the qif and hence spoiled the format

Expected behaciour: any linebreak should be replace on pasting not only ignored and shown as a white space in the App

FatherMcGruder commented 4 years ago

I've also been having a problem exporting to QIF. I wonder if I have something pasted into one of my transactions that's not allowed. How did you find the line break in the QIF file? Were you able to trace it to a certain transaction and fix it?

nottheend commented 4 years ago

Yes, have been able to find in the following way:

  1. Opened the QIF with an text editor
  2. Scammed through the content, always checking the beginning of the line
  3. Whenever I found an unexpected beginning, which means it started with a description of a transaction, I just removed that linebreak

By that I found it quite quickly.

Before that I excluded manually one transaction at a time, then importing it, but that was annoying and took time. Afterwards I checked above method.

FatherMcGruder commented 4 years ago

Yes, have been able to find in the following way:

1. Opened the QIF with an text editor

2. Scammed through the content, always checking the beginning of the line

3. Whenever I found an unexpected beginning, which means it started with a description of a transaction, I just removed that linebreak

By that I found it quite quickly.

Before that I excluded manually one transaction at a time, then importing it, but that was annoying and took time. Afterwards I checked above method.

Thanks, @nottheend. I realized that the problem (part of the problem, anyway) is that GnuCash is actually exporting compressed archives, but giving them a .qif extension rather than a .zip extension. I've updated my issue accordingly. After extracting the archive, I can now open and read the actual QIFs (I have multiple because of transactions in different currencies). Some of them import properly, but the main USD QIF file still does not. I now get a "Commission: Unrecognized or inconsistent format" error in GnuCash Desktop. It looks like someone else got this error in 2014. Something might be wrong with one or more of my USD transactions. I don't see anything weird as I scroll through the QIF so I will try excluding transactions and hopefully I can find it.

UPDATE: It took me a little while, but I found the problem. It was a line break just like the OP. Be careful about copy-pasting into the transaction description field, folks!

nottheend commented 4 years ago

Good to know @FatherMcGruder, that you also discovered the same. The linebreak issue should be an easy one to fix, anyway.

I am still thinking to fork this repo to let the development continue, as stated in #841. Recently I dedicatedly ask the repo owner to merge pending pull requests. However, no response yet.