I got around to looking at this a little more. Here's what I've been working on:

1) Compiling a list of bank information (capabilities, URLs of OFX servers, etc). This is more or less done. See http://www.jongsma.org/gc/ for details. Pretty much everything I've found relating to OFX online transactions will make its way onto that page eventually.

2) Spec'ing out a user interface for configuring/using OFX in GnuCash. When I'm done with that, the screenshots will be on that same URL (under the "User Interface" section). I'm not familiar with the plugin architecture but hopefully there is some way to tie this into the Scheduled Transactions and Account Register components to support handling recurring online transactions (I understand HBCI also supports this, but it is not yet implemented in GnuCash). Just downloading statements would be a great start though.

I also uploaded a copy of Microsoft's test definitions spreadsheet to my web site (see previous link). This contains a definition of every OFX request/response transaction that MS Money supports. It may be a useful reference for determining what types of transactions to support to support via GnuCash (i.e. online transfer, pin change, statement download, recurring transactions, etc).

Has anyone volunteered to coordinate (or start) this project? I'd be happy to help out, but I have a feeling it should involve someone who can actually code in C. If anyone is currently thinking about this functionality or is interested in working on it let me know. Otherwise I might have to pick up my C books again, and that'll be painful for everyone involved... :)

-j

Christian Stimming wrote:
Derek Atkins schrieb:

Jeremy Jongsma <[EMAIL PROTECTED]> writes:


Benoit et. al., please let me know if there's any way I can help
out. Unfortunately, it would have to be a way that doesn't involve C
coding. But I could help with feature requirements for a download
druid (from my user experiences with Money and Quicken), or compile a
list of banks and their capabilities in XML format for the druid to
use, or just do beta testing when the time comes...



You might want to take a look at what HBCI does.. Also, spec'ing out how the UI should act in the face of direct connect _AND_ "import-a-file" mechanisms would be a major help....


If you take the python code that connects to the bank, and then add C functions around it that can call these routines, then you will actually have something that is just the same as HBCI's "get transactions" action.

This HBCI action is implemented in src/import-export/hbci/gnc-hbci-gettrans.c as follows. (This description is for the gnucash-1-8-branch; the HEAD branch just recently switched to the openhbci2 library, which is still not yet stable. It is almost identical but in some points it's less intuitive than the openhbci-0.x, so this description is still for 1-8-branch and openhbci-0.x)

- On gnucash startup, the HBCI module installs a menu item "Actions -> Online Actions -> HBCI Get Transactions" in gncmod-hbci.c:93
- the menu item callback is defined in gnc-hbci-cb.c:57
- the actual action function gnc_hbci_gettrans() is in gnc-hbci-gettrans.c
- The account details (account id, bank code) are stored in some special KvpFrame of the account and retrieved via gnc_hbci_get_hbci_acc() defined in gnc-hbci-kvp.h/c, as used in gnc-hbci-gettrans.c:80
- The KvpFrame of the account also stores the timestamp of the last transaction retrieval, which is used as a useful default for querying the user about the time interval for transaction retrieval (a function that is nicely implemented by the HBCI protocol) in gnc_hbci_enter_daterange(), as used in gnc-hbci-gettrans.c:170
- The download job itself is managed by the HBCI library openhbci; you can view its API on http://openhbci.sourceforge.net/doc/api/index.html ; these functions would be replaced by calls to the yet-to-be-written python/C OFX download library/code.
- The transactions are imported into gnucash by calling gnc_gen_trans_list_add_trans() for each downloaded transaction, as implemented in gnc_hbci_gettrans_final(); in that function, the data structure HBCI_OutboxJobGetTransactions contains all the downloaded transactions.


The point is this: Once someone manages to write a C function that simply implements the action "download OFX file from the bank and return its content" then the rest of the necessary gnucash code can be shamelessly copied from this existing HBCI code.

I'm not sure whether a more generic framework actually makes sense. As explained, the HBCI code already uses the "generic transaction matcher" for the final step of the import. But all the rest of the described HBCI code is pretty much only concerned with the step-by-step initialization of the openhbci library and finally converting the downloaded HBCI transaction data into gnucash transactions -- and these steps will always be HBCI- or OFX- or whatever-specific. On the other hand, it might yet make sense to have a common UI framework for e.g. querying the user about the time interval for transaction retrieval (gnc_hbci_enter_daterange() in dialog-daterange.h). If people concerned with the OFX code decide that adding an common UI framework would help, then I would be very open to modify the HBCI code accordingly.

Christian

-- Jeremy Jongsma [EMAIL PROTECTED] http://www.jongsma.org _______________________________________________ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnucash.org/cgi-bin/mailman/listinfo/gnucash-devel

Reply via email to