Hendrik Boom <[EMAIL PROTECTED]> writes:
> Where is the code that checks for duplicate transactions during import?

It's in src/scm/qif-import/qif-to-gnc.scm .  The critical function is
at the bottom of the file, and it's called (qif-split:split-matches?).

At this point, QIF splits imported at the same time are considered to
match if the account references are correct, the amounts are equal,
and the date is the same.  Memos aren't checked for the very reason
that you describe; I guessed that there will be cases where various
other fields are not matching but the splits are in fact describing
the same transaction.

This match rule may seem lenient to some; I'm open to changing it if
someone comes up with a case where it does the wrong thing.

If you import two representations of the same transaction at different
times (i.e. in two different invocations of the QIF import dialog),
there's no guarantee that the right thing will happen.  My next step
is to start looking at this case (say, from incremental QIF imports
from on-line banking web sites) and be more careful in finding
"delayed" matches for transactions.  I use xaccMergeAccounts on the
backend, so whatever it does to eliminate duplicates is as good as can
be expected now.

> The obvious place to make the changes in xaccSplitMatch or
> xaccTransMatch, but I can't seem to find how they are called from
> QIFIO or gc-import-qifs.  Am I still missing something here?

QIFIO.c isn't where the importing is done any more.  The QIF import
dialog functions are defined in src/gnome/dialog-qif-import*, the GUI
layout is in auto-generated Glade output files
src/gnome/glade-*-qif-*, and most of the actual intelligence is in the
Scheme code found in src/scm/qif-import.  There's fairly thorough HTML
documentation pinned to the "help" button on the dialog.

It could probably be argued that I should have fixed up the existing C
code, or Chris Browne's Scheme code, rather than rewriting it from
scratch, but I wanted to get up to speed on Gnucash and this seemed
like a project that sort of cut a cross-section through most of the
relevant technologies.

Bill Gribble

--
Gnucash Developer's List 
To unsubscribe send empty email to: [EMAIL PROTECTED]


Reply via email to