r19744 - gnucash/trunk/src/engine - Bugs 632346 & 632166: Fixup transaction currency scrubbing.
John Ralls
jralls at code.gnucash.org
Tue Nov 2 17:14:38 EDT 2010
Author: jralls
Date: 2010-11-02 17:14:38 -0400 (Tue, 02 Nov 2010)
New Revision: 19744
Trac: http://svn.gnucash.org/trac/changeset/19744
Modified:
gnucash/trunk/src/engine/Scrub.c
Log:
Bugs 632346 & 632166: Fixup transaction currency scrubbing.
Biggest problem was that almost well-formed transactions missing a currency
element wouldn't import correctly because the FindCommonCurrencies function
only used the old currency values, ignoring the commodity values in the
splits' accounts. A new function, xaccFindCommonCurrencies(), looks at those
first and then calls xaccFindOldCommonCurrencies only if it fails. That
addresses the cause of the import failure reported in 632166 and a big chunk
of the warning messages complained about in 632346.
A secondary problem, also addressed in this change, was that the last block
in xaccTransScrubCurrencyFromSplits always replaced the "amount" with the
"value". This is the right thing to do if the commodity for the split account
is a currency, but if it isn't, the replacement should be reversed.
More information about the gnucash-patches
mailing list