OFX Investment Import

Hubert Bahr hab at hbahr.org
Thu Dec 14 14:39:03 EST 2006


   Christian Stimming wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hubert Bahr schrieb:
  

As suggested I am starting with OFX Import.  Investigation of libofx
shows that it supports sufficient fields to provide the necessary data,
based on the examination of its ofxdump utility.  
  
I have established bug 385366 as a collection point for file transfers,
and uploaded two files the first id 78266 is an ofx file to be used as
the initial test case.  The second id# 78267 is the output of ofxdump.
It will be used for the initial discussions.  
    

That's [1]http://bugzilla.gnome.org/show_bug.cgi?id=385366 . Thanks for the
initial test file there.

(NB: It was quite unexpected to have the second file in
OpenOffice-Writer format (ODT). In the future I'd ask you to stick to
plain text files, as this is more easily accessible on the bunch of
machines developers tend to have around. But nevermind.)

Can you please explain now more clearly which parts of your test file
are imported correctly, and which parts are erroneous or missing data?
Please be as specific as possible (for one concrete example).


   An  enlightening  challenge.  It turns out OFX investment import works
   sometime.  It is very sensitive to the creation of the transaction account
   and  the  commodity  accounts.   Using previously established accounts
   definitely doesn't work.  I have best results when creating the accounts and
   commodities from scratch on an initial import of the file.  However, that
   seems to work in varying degrees depending on structure.  I am still trying
   to document the differences, but in my opinion it is hyper-sensitive to this
   situation and needs to be desensitized.  One problem is, there seems to be
   no way to clear the previously learned connections between the accounts
   without deleting the accounts.  This is a real pain when you started the
   account using one method and then try to change to a new strategy especially
   when the new method doesn't provide all the data.  If we only had an ofx
   export that might help.  Once, I understand the differences, I will collect
   individual account structures and example ofx files.
   Where does the account mapping occur, and how is it saved?



Where would I find the appropriate functions for passing these values to
the engine.  Some of them seem to be described in
src/engine/Transaction.h but the list seems incomplete.

To me the majority of the changes look like they belong in
ofx_proc_transaction_cb of gnc-ofx-import.c


Yes, absolutely. You have to retrieve the data from libofx by accessing
the members of the "struct OfxTransactionData" (the variable "data") and
write it into the gnucash transaction (variable "transaction") or its
first split (variable "split") by using the xaccTransactionSet... or
xaccSplitSet... functions for Transaction.h or Split.h, respectively.

As for the difference Transaction vs. Split: The final transaction
contains two or more splits; each split represents the amount that goes
into one particular account. If you want to read more of this, read the
comments in Transaction.h and Split.h.

Also, do you work with SVN-trunk source code for this? I hope so.


   I am working with the SVN-trunk and also comparing to a previous release.
   How often do I need to update?

Regards,

Christian


   Thanks
   Hubert

References

   1. http://bugzilla.gnome.org/show_bug.cgi?id=385366


More information about the gnucash-devel mailing list