Summary: | GNUCash importer creates invalid price entries | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Susannah Burrows <susannah.burrows> |
Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED WAITINGFORINFO | ||
Severity: | normal | CC: | susannah.burrows, tonyb.sfkde |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Susannah Burrows
2010-05-18 18:06:37 UTC
Can you try to update each stock individually, to verify if there is a particular one causing the problem? Also, saving your file as anonymous file and attaching it to the bug might help us pinpoint the problem. I use the Update all feature regularly and it works fine here, so it might be a particular source on one of your stocks. Thanks for the quick reply! I have updated each stock individually many times with no problems. Could you explain to me how I can save my file as an "anonymous" file? I think I've just discovered what is triggering the bug: the stock prices were in USD, but the base currency was EUR. After changing the base currency to USD (matching the currency of all stock prices), saving the file, and restarting KMyMoney, I am no longer able to reproduce the bug. When I switch back to using EUR as the base currency, the buggy behavior reappears. This is good news for me, since it gives me a workaround. However, I think it is still a bug that could affect users with multiple currencies, especially if they have investments in multiple currencies, in which case it is probably not possible to avoid the bug. Weird. I do have stocks in multiple currencies. To save as anonymous file, go to Save As.. and select anon.xml in the format. The problem's source seems to be in the area of the GnuCash importer. Details will follow. Yep, it really looks the GnuCash importer caused this trouble. Here's what I see in the anon file provided by Susannah who also confirms the import from GNC: <PRICEPAIR from="E000019" to="USD"> <PRICE price="143600/10000" source="Imported Transaction" date="2007-11-28"/> : : </PRICEPAIR> where E000019 links to the symbol MYL. In addition I see <PRICEPAIR from="USD" to="MYL"> <PRICE price="359/25" source="Imported History" date="2007-11-28"/> </PRICEPAIR> which is the same price on the same date but in a complete wrong format. The file contained this scenario a second time, this time even weirder: <PRICEPAIR from="E000003" to="USD"> <PRICE price="756200/10000" source="Imported Transaction" date="2005-10-31"/> : <PRICE price="540100000/10000000" source="Imported History" date="2007-05-15"/> <PRICE price="542800/10000" source="Imported Transaction" date="2007-05-16"/> <PRICE price="538670000/10000000" source="Imported History" date="2007-05-22"> : </PRICEPAIR> where E000003 links to the symbol AMGN. In addition I see <PRICEPAIR from="USD" to="AMGN"> <PRICE price="58643/3183140" source="Imported History" date="2007-05-16"/> </PRICEPAIR> though the price differs this time but the date is the same. The fun stuff is, that this is based on the second imported transaction and I don't see something like that generated for the first imported transaction referencing that security. So I would suggest to take a look at the part that causes price entries based on transactions. I might be wrong though. We followed up on this off b.k.o and indeed, removing those weird entries solved the problem. We now need to investigate why this happened in the first place to avoid it in the future. Susannah still has the original Gnumeric data file where she imported from, so if someone knowledgeable about the GncImport needs information about that file, please contact her. I'll look into the code, but as far as I can recall, GNC uses the same numerator/denominator strings as KMM, so I don't think the importer messes with them, just copies them. We don't have a detailed spec of the GNC file format, so it's possible that it interprets them incorrectly with regard to the currencies/investments involved. I'm pretty sure I never tested it against a file with multiple investment currencies, so I'm not too surprised there are problems. (But I'm a little mystified as to how funny historical prices could cause a crash.) Rescheduled severity and adjusted title to reflect the problem. Any news on this? Otherwise, I'll close it. |