Bug 409098 - Gnucash importer ignores the accounts currencies
Summary: Gnucash importer ignores the accounts currencies
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: importer (show other bugs)
Version: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-24 00:43 UTC by Dawid Wróbel
Modified: 2019-06-24 16:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.0.5


Attachments
Obfuscated Gnucash xml (2.29 MB, application/gzip)
2019-06-24 00:43 UTC, Dawid Wróbel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Wróbel 2019-06-24 00:43:52 UTC
Created attachment 121104 [details]
Obfuscated Gnucash xml

SUMMARY
I attempted to migrate my finances to kmymoney. However, while the transactions and accounts are migrated properly, the currencies of each account are not. 

The gnucash data attached is obfuscated. It contains ~20k transactions. The import itself is reasonably quick, but after choosing the base currency, the MyMoneyStorageMgr::transactionCount() is painfully slow.

STEPS TO REPRODUCE
1. Import GnuCash file
2. You can skip the base currency selection to avoid the slow tranasactionCount() 

OBSERVED RESULT
If you choose the base currency at import time, all accounts will end up having the same base currency set. If you skip the base currency selection, the accounts will display the transactions and summaries all with an unspecified denomination. Right-clicking on each of them will reveal the currency box greyed-out and set to HRK, but HRK does not show up next to any value on any of the views. The currency itself seems random, too: I do have one or two accounts denominated in HRK, but the majority is USD and PLN.

EXPECTED RESULT
The accounts to have their currencies correctly migrated.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Ubuntu 19.04
KDE Plasma Version:  
KDE Frameworks Version: 5.56.0 
Qt Version: 5.12.2

ADDITIONAL INFORMATION
Tested with both git master and Ubuntu's 5.0.3 from the repository.
Comment 1 Thomas Baumgart 2019-06-24 16:33:02 UTC
Git commit d2dc4d7b5a9090b2a7c55b244644fa565478dc75 by Thomas Baumgart.
Committed on 24/06/2019 at 16:32.
Pushed by tbaumgart into branch '5.0'.

Fix GnuCash importer to import currencies

Support currencies that are stored with
  <cmdty:space>CURRENCY</cmdty:space>
in addition to ones stored with
  <cmdty:space>ISO4217</cmdty:space>.

Also, only load those currencies that are used in the GnuCash file.
FIXED-IN: 5.0.5

M  +27   -21   kmymoney/plugins/gnc/import/mymoneygncreader.cpp
M  +2    -6    kmymoney/plugins/gnc/import/mymoneygncreader.h

https://commits.kde.org/kmymoney/d2dc4d7b5a9090b2a7c55b244644fa565478dc75