[Kmymoney] Is this a bug?

Allan agander93 at gmail.com
Fri Mar 23 22:18:31 UTC 2012


On importing a csv file, an incorrect column was used for the 'amount' 
field, which in fact contained a string which included a couple of 
values.  The string was accepted, and the amount became the 
concatenation of the two values, resulting in a huge value.

I realised that it would be wise to test for valid values, and started 
to think about validation.  Knowing that MyMoneyMoney converted text to 
a MyMoneyMoney value, and, not wanting to reinvent the world, I looked 
to see if there was a validity test, but found none, so looked in 
qifimportreader(), and there did not appear to be a specific test there, 
either.

So, I imported the following qif file -

!Account
NtestG
TBank
^
!Type:Bank
D1/9/00
U524.91
TThis234.56isrubbish24.91
CX
POpen
^

It was imported successfully, with the result being a value of 
2,345,624.91!  So, that was exactly the same sort of result the csv 
import produced.

Of course, a qif file 'T' line is expected to have a genuine value, and 
if it is incorrect, then the supplier is at fault.  Similarly for the 
csv import, but because an extra step involving the user in selecting 
the correct column is required, the risk is greater.

How far should one go in validation?  Should qif import also validate?

Allan


More information about the KMyMoney mailing list