[Aqbanking-devel] Direct Investment import to GNUCash

Christian Stimming stimming at tuhh.de
Tue Dec 5 03:33:28 EST 2006

Hash: SHA1

(huh, that's a lot of lists being cross-posted to.)

Hubert Bahr schrieb:
> I recently tried to import investment information into GNUCash.  The
> problem I see is the loss of the commodity price during import.  When I
> get the Info in QIF format this loss doesn't occur.  When I import in
> OFX the loss does occur and this is also true when I use direct
> connect.  The same is not true when I import into Quicken.
> Investigation into the OFX file shows that the information is
> available.  It just isn't being used.  

As you have already noticed, there are two ways of importing OFX data
into GnuCash:

#1 Import data from an OFX file

#2 Use "OFX DirectConnect" for direct data retrieval from a bank server
that happens to send its data in the OFX format

For #1, questions about particular data fields that don't show up in
GnuCash have to be solved in libofx and GnuCash and this is probably the
easier problem. First you would have to check for code in libofx (or add
it) that reads this particular data from the OFX file (or stream). Then
you would have to add interface functions to libofx that make this data
accessible to the users of libofx. Eventually you have to add the
retrieval functions into gnucash's ofx import code in
src/import-export/ofx/gnc-ofx-import.c although this might also require
additions to the "generic importer" code in src/import-export/*.c.

Note that the QIF importer does not share any program parts with any of
the other importer features in GnuCash. It is very well possible that
because of this, it supports a whole lot of other data that the others
don't support.

Discussion about the necessary libofx extensions should happen solely on
the libofx-devel mailing list. Discussion about the necessary GnuCash
extensions are warmly welcome on gnucash-devel. The connection between
both can be discussed on both, of course.

On the other hand, for #2 you not only have to extend libofx and
GnuCash, but additionally you have to extend aqbanking. The issue is
that aqbanking tries to be a *general* online banking library, hence all
data types are intended to present some sort of common denominator of
all protocols that are being supported. For aqbanking, OFX DirectConnect
is only one out of several possible data retrieval interfaces. You would
have to find an interface that represents your additional data in a way
that is still abstract enough for the general interface in aqbanking. I
can imagine this to be the hardest part of this extension.
http://bugzilla.gnome.org/show_bug.cgi?id=347741 describes the RFE
you're asking for.

> I am willing to work on this,
> however I could use some help determining where to start.  I can provide
> a test case.  To date I see that all three cases use different paths
> into GNUcash.  However, both Direct connect and OFX import use libofx.
> I do see some additional differences in Direct Connect and OFX import.
> But they both lose the quantity and value of the commodity.

I'd suggest you should work on #1. First you should check whether libofx
provides the data through some interface, and if it doesn't, you would
have to add code to libofx. Then you should work on gnucash's
src/import-export/ofx/gnc-ofx-import.c (please make sure to use SVN
trunk for such additions), add the code and keep some documentation
somewhere about the necessary additions (so that we know what the
DirectConnect importer will need as well). You should probably start a
wiki page http://wiki.gnucash.org for keeping those notes, and/or start
an extra Bugzilla RFE
http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash which is useful
if you want to upload test files (file upload in the wiki is currenly
not available).


Version: GnuPG v1.4.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the gnucash-devel mailing list