2002-12-10 Benoit Gr�goire <bock@step.polymtl.ca>

* src/import-export/*: Add user pref to allow HBCI users to select if they want Christian's matcher or mine.  Update OFX readme.  Update column width in account-picker.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7669 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/g2-gog-integ
Benoit Grégoire 24 years ago
parent dc694d64a9
commit 05dfc2119f

@ -1,3 +1,9 @@
2002-12-10 Benoit Grégoire <bock@step.polymtl.ca>
* src/import-export/*: Add user pref to allow HBCI users
to select if they want Christian's matcher or mine.
Update OFX readme.
Update column width in account-picker.
2002-12-09 Christian Stimming <stimming@tuhh.de>
* po/nl.po: Updated translation by Hendrik-Jan Heins

@ -499,12 +499,13 @@
-Select &quot;R&quot; to Reconcile a matching transaction
-Select neither to Skip (The transaction won't be imported at all)
-&quot;Select Import Action&quot; allows you to change the matching transaction to reconcile, or the destination account of the auto-balance split (if required).</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<justify>GTK_JUSTIFY_FILL</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<focus_target>matcher_ok</focus_target>
<child>
<padding>0</padding>
<expand>False</expand>

@ -6,11 +6,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Register Preferences
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
(N_ "Transaction Matcher") (N_ "Enable SKIP transaction action")
"b" (N_ "Enable the SKIP action in the transaction matcher. If enabled, a transaction whose best match's score is in the yellow zone (above the Auto-ADD threshold but below the Auto-CLEAR threshold) will be SKIPed by default.")
#t))
;(gnc:register-configuration-option
; (gnc:make-simple-boolean-option
; (N_ "Transaction Matcher") (N_ "Enable SKIP transaction action")
; "b" (N_ "Enable the SKIP action in the transaction matcher. If enabled, a transaction whose best match's score is in the yellow zone (above the Auto-ADD threshold but below the Auto-CLEAR threshold) will be SKIPed by default.")
; #t))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option

@ -31,7 +31,10 @@
#include "date.h"
#include "Transaction.h"
#include "gnc-engine-util.h"
#include "gnc-gen-transaction.h"
#include "import-main-matcher.h"
#include "global-options.h"
#include "hbci-interaction.h"
#include "gnc-hbci-utils.h"
@ -41,12 +44,16 @@
/* static short module = MOD_IMPORT; */
static const gboolean DEFAULT_USE_GENERIC_MATCHER = FALSE;
static void *trans_list_cb (const HBCI_Transaction *trans, void *user_data);
struct trans_list_data
{
Account *gnc_acc;
GNCGenTransaction *importer;
GNCImportMainMatcher *importer_generic;
gboolean use_generic_matcher;
};
@ -183,21 +190,43 @@ gnc_hbci_gettrans (GtkWidget *parent, Account *gnc_acc)
if (list_HBCI_Transaction_size(trans_list) > 0) {
struct trans_list_data data;
GNCGenTransaction *importer_gui;
importer_gui = gnc_gen_trans_new (NULL, NULL);
gnc_gen_trans_freeze (importer_gui);
gnc_gen_trans_set_fuzzy_amount (importer_gui, 0.0);
GNCGenTransaction *importer_gui = NULL;
GNCImportMainMatcher *importer_generic_gui = NULL;
data.use_generic_matcher = gnc_lookup_boolean_option("Online Banking & Importing",
"HBCI Use generic import matcher",
DEFAULT_USE_GENERIC_MATCHER);
if(data.use_generic_matcher)
{
importer_gui = gnc_gen_trans_new (NULL, NULL);
gnc_gen_trans_freeze (importer_gui);
gnc_gen_trans_set_fuzzy_amount (importer_gui, 0.0);
data.importer = importer_gui;
}
else
{
importer_generic_gui = gnc_gen_trans_list_new(NULL, NULL, TRUE);
data.importer_generic = importer_generic_gui;
}
data.gnc_acc = gnc_acc;
data.importer = importer_gui;
list_HBCI_Transaction_foreach (trans_list, trans_list_cb, &data);
gnc_gen_trans_thaw (importer_gui);
if(data.use_generic_matcher==FALSE)
{
gnc_gen_trans_thaw (importer_gui);
}
GNCInteractor_hide (interactor);
gnc_gen_trans_run (importer_gui);
if(data.use_generic_matcher)
{
gnc_gen_trans_list_run (importer_generic_gui);
}
else
{
gnc_gen_trans_run (importer_gui);
}
}
else {
GNCInteractor_hide (interactor);
@ -299,7 +328,13 @@ static void *trans_list_cb (const HBCI_Transaction *h_trans,
/* Instead of xaccTransCommitEdit(gnc_trans) */
/*gnc_import_add_trans(gnc_trans);*/
gnc_gen_trans_add_trans (data->importer, gnc_trans);
if(data->use_generic_matcher)
{
gnc_gen_trans_list_add_trans (data->importer_generic, gnc_trans);
}
else
{
gnc_gen_trans_add_trans (data->importer, gnc_trans);
}
return NULL;
}

@ -40,3 +40,9 @@
(gnc:register-configuration-option
(gnc:make-internal-option
"__gui" "hbci_close_on_finish" 1))
(gnc:register-configuration-option
(gnc:make-simple-boolean-option
(N_ "Online Banking & Importing") (N_ "HBCI Use generic import matcher")
"b" (N_ "Use the transaction matcher from the generic import infrastructure instead of the HBCI specific one")
#f))

@ -144,8 +144,15 @@ build_acct_tree(struct _accountpickerdialog * picker) {
acct_tree_add_accts(picker, picker->acct_group, GTK_CTREE(picker->treeview), NULL);
gtk_clist_columns_autosize (GTK_CLIST (picker->treeview));
gtk_clist_column_titles_passive (GTK_CLIST (picker->treeview));
gtk_clist_set_column_auto_resize (GTK_CLIST (picker->treeview),
CLIST_NAME,
TRUE);
gtk_clist_set_column_auto_resize (GTK_CLIST (picker->treeview),
CLIST_TYPE,
TRUE);
gtk_clist_columns_autosize (GTK_CLIST (picker->treeview));
gtk_clist_thaw (GTK_CLIST(picker->treeview));
}

@ -41,7 +41,7 @@
#include "import-backend.h"
#include "import-account-matcher.h"
struct _generic_transaction_info
struct _main_matcher_info
{
GtkWidget *dialog;
GtkWidget *clist;
@ -211,10 +211,10 @@ static char * checkbox_unchecked_xpm[] = {
"............"};
static void
refresh_clist_row (GNCGenTransaction *gui,
refresh_clist_row (GNCImportMainMatcher *gui,
int row_number, GNCImportTransInfo *info);
void gnc_gen_trans_list_delete (GNCGenTransaction *info)
void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
{
if (info == NULL)
return;
@ -228,7 +228,7 @@ static void
on_matcher_ok_clicked (GtkButton *button,
gpointer user_data)
{
GNCGenTransaction *info = user_data;
GNCImportMainMatcher *info = user_data;
g_assert (info);
/* DEBUG ("Begin") */
gnc_import_process_trans_clist (GTK_CLIST (info->clist), NULL);
@ -241,12 +241,12 @@ static void
on_matcher_cancel_clicked (GtkButton *button,
gpointer user_data)
{
GNCGenTransaction *info = user_data;
GNCImportMainMatcher *info = user_data;
gnc_gen_trans_list_delete (info);
}
static void
run_account_picker_dialog (GNCGenTransaction *info,
run_account_picker_dialog (GNCImportMainMatcher *info,
gint row, GNCImportTransInfo *trans_info)
{
Account *old_acc, *new_acc;
@ -269,7 +269,7 @@ run_account_picker_dialog (GNCGenTransaction *info,
}
static void
run_match_dialog (GNCGenTransaction *info,
run_match_dialog (GNCImportMainMatcher *info,
gint row, GNCImportTransInfo *trans_info)
{
gnc_import_match_picker_run_and_close (trans_info);
@ -282,7 +282,7 @@ clist_select_row_cb (GtkCList *clist,
GdkEventButton *event,
gpointer user_data)
{
GNCGenTransaction *gui = user_data;
GNCImportMainMatcher *gui = user_data;
GNCImportTransInfo *trans_info;
gboolean should_refresh = TRUE;
DEBUG("row_number: %d%s%d",row_number,", column: ",column);
@ -358,29 +358,29 @@ clist_select_row_cb (GtkCList *clist,
column);
}
void gnc_gen_trans_list_freeze (GNCGenTransaction *gui)
static void gnc_gen_trans_list_freeze (GNCImportMainMatcher *gui)
{
g_assert (gui);
gtk_clist_freeze (GTK_CLIST (gui->clist));
}
void gnc_gen_trans_list_thaw (GNCGenTransaction *gui)
static void gnc_gen_trans_list_thaw (GNCImportMainMatcher *gui)
{
g_assert (gui);
gtk_clist_thaw (GTK_CLIST (gui->clist));
}
GNCGenTransaction *gnc_gen_trans_list_new (GtkWidget *parent,
GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
const gchar* heading,
gboolean all_from_same_account)
{
GNCGenTransaction *info;
GNCImportMainMatcher *info;
GladeXML *xml;
GtkWidget *heading_label;
gnc_should_log(MOD_IMPORT, GNC_LOG_TRACE);
info = g_new0 (GNCGenTransaction, 1);
info = g_new0 (GNCImportMainMatcher, 1);
/* Initialize user Settings. */
info->user_settings = gnc_import_Settings_new ();
@ -483,7 +483,7 @@ GNCGenTransaction *gnc_gen_trans_list_new (GtkWidget *parent,
return info;
}
gboolean gnc_gen_trans_list_run (GNCGenTransaction *info)
gboolean gnc_gen_trans_list_run (GNCImportMainMatcher *info)
{
gboolean result;
@ -522,7 +522,7 @@ static char ** gen_clist_row_text (GNCImportTransInfo *info)
static void
refresh_clist_row (GNCGenTransaction *gui,
refresh_clist_row (GNCImportMainMatcher *gui,
int row_number, GNCImportTransInfo *info)
{
char *text[NUM_COLUMNS_DOWNLOADED_CLIST];
@ -759,7 +759,7 @@ refresh_clist_row (GNCGenTransaction *gui,
}
void gnc_gen_trans_list_add_trans(GNCGenTransaction *gui, Transaction *trans)
void gnc_gen_trans_list_add_trans(GNCImportMainMatcher *gui, Transaction *trans)
{
GNCImportTransInfo * transaction_info = NULL;
gint row_number;

@ -24,13 +24,13 @@
@author Christian Stimming
*/
#ifndef GNC_GEN_TRANSACTION_H
#define GNC_GEN_TRANSACTION_H
#ifndef GNC_IMPORT_MAIN_MATCHER_H
#define GNC_IMPORT_MAIN_MATCHER_H
#include <gnome.h>
#include "Transaction.h"
typedef struct _generic_transaction_info GNCGenTransaction;
typedef struct _main_matcher_info GNCImportMainMatcher;
/** Create a new generic transaction dialog window and return it.
@param parent The parent GtkWidget. May be NULL.
@ -39,12 +39,12 @@ typedef struct _generic_transaction_info GNCGenTransaction;
that will be added with gnc_gen_trans_list_add_trans are from the same
source account. This will cause the account column to be hidden.
*/
GNCGenTransaction *gnc_gen_trans_list_new (GtkWidget *parent,
GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
const gchar* heading,
gboolean all_from_same_account);
/** Deletes the given object. */
void gnc_gen_trans_list_delete (GNCGenTransaction *info);
void gnc_gen_trans_list_delete (GNCImportMainMatcher *info);
/** Add a newly imported Transaction to the Transaction Importer.
@param gui The Transaction Importer to use.
@ -53,23 +53,13 @@ void gnc_gen_trans_list_delete (GNCGenTransaction *info);
Only the first split will be used for matching. The
transaction must NOT be commited.
*/
void gnc_gen_trans_list_add_trans(GNCGenTransaction *gui, Transaction *trans);
void gnc_gen_trans_list_add_trans(GNCImportMainMatcher *gui, Transaction *trans);
/** Run this dialog and return only after the user pressed Ok, Cancel,
or closed the window. This means that all actual importing will
have been finished upon returning.
*/
gboolean gnc_gen_trans_list_run (GNCGenTransaction *info);
/** Freeze the underlying GtkCList. Do this before you add a lot of
transactions. */
void gnc_gen_trans_list_freeze (GNCGenTransaction *gui);
/** Thaw the underlying GtkCList. Do this after you added a lot of
transactions. */
void gnc_gen_trans_list_thaw (GNCGenTransaction *gui);
gboolean gnc_gen_trans_list_run (GNCImportMainMatcher *info);
#endif
/**@}*/

@ -38,6 +38,8 @@
* If you modify the value of any of these, you must do the same in *
* generic-import.scm *
\********************************************************************/
#define MATCHER_PREF_PAGE "Transaction Matcher"
/** Transaction who's best match probability is equal or higher than
this will reconcile their best match by default */
#define DEFAULT_CLEAR_THRESHOLD 5
@ -98,27 +100,27 @@ gnc_import_Settings_new (void)
settings->action_skip_enabled =
gnc_lookup_boolean_option("Transaction Matcher",
gnc_lookup_boolean_option(MATCHER_PREF_PAGE,
"Enable SKIP transaction action",
DEFAULT_ACTION_SKIP_ENABLED);
settings->action_edit_enabled =
gnc_lookup_boolean_option("Transaction Matcher",
gnc_lookup_boolean_option(MATCHER_PREF_PAGE,
"Enable EDIT match action",
DEFAULT_ACTION_EDIT_ENABLED);
settings->action_add_enabled=DEFAULT_ACTION_ADD_ENABLED;
settings->action_clear_enabled=DEFAULT_ACTION_CLEAR_ENABLED;
settings->clear_threshold=gnc_lookup_number_option("Transaction Matcher",
settings->clear_threshold=gnc_lookup_number_option(MATCHER_PREF_PAGE,
"Auto-CLEAR threshold",
DEFAULT_CLEAR_THRESHOLD);
settings->add_threshold=gnc_lookup_number_option("Transaction Matcher",
settings->add_threshold=gnc_lookup_number_option(MATCHER_PREF_PAGE,
"Auto-ADD threshold",
DEFAULT_ADD_THRESHOLD);
settings->display_threshold =
gnc_lookup_number_option("Transaction Matcher","Match display threshold",
gnc_lookup_number_option(MATCHER_PREF_PAGE,"Match display threshold",
DEFAULT_DISPLAY_THRESHOLD);
settings->fuzzy_amount =
gnc_lookup_number_option("Transaction Matcher","Commercial ATM fees threshold",
gnc_lookup_number_option(MATCHER_PREF_PAGE,"Commercial ATM fees threshold",
DEFAULT_ATM_FEE_THRESHOLD);
return settings;

@ -1,23 +1,22 @@
This is the new OFX import module. It's still very young, but it is now ready for other people to test.
Note: You should also read src/import-export/generic-import-design.txt
This is the new OFX import module.
Implemented features (some of these are from the generic import module):
-OFX file selection
-Account matching, using unique OFX account ID
-Account creation
-Transaction duplicate matching, using the unique OFX transaction ID only.
-Transaction duplicate detection, using the unique OFX transaction ID.
-Saving of ALL transaction data currently supported by LibOFX. When no gnucash equivalent, it is put in the Transaction's Note field. You must have double-line mode enabled to view the notes field.
-Full OFX investment transaction support, including commodity import and matching.
Unimplemented features:
-Account currency compatibility check
-Automaticaly set sane defaults when creating new account (parent account, sibling, currency, etc.)
-Transaction fuzzy matching and split balancing
To compile:
./autogen.sh --enable-ofx
Add --enable-ofx to ./autogen.sh (for CVS) or ./configure (for tarballs)
make
If sucessfull, an item will apear in Gnucash's File/Import submenu.
If successfull, an item will apear in Gnucash's File/Import submenu.
You must have LibOFX > 0.23 installed. http://step.polymtl.ca/~bock/libofx/
LibOFX depends on OpenSP , read LibOFX's "INSTALL" file. LibOFX needs a recent version (1.5pre5 as of this writing, 1.4 might work).
I suggest you first run your ofx file thru ofxdump before you try it from GnuCash.diff -up 'gnucash_orig/src/import-export/ofx/gnc-ofx-import.c' 'gnucash_test/src/import-export/ofx/gnc-ofx-import.c'
You must have LibOFX > 0.32 installed. http://libofx.sourceforge.net/
LibOFX depends on OpenSP , read LibOFX's "INSTALL" file. LibOFX needs a recent version (1.5pre5 as of this writing, 1.4 will probably work fine, 1.3.x MIGHT work, but is very buggy and depends on horrible kludges in the LibOFX code. You have been warned.).
You may want to first run your ofx file thru ofxdump to test your libofx installation before you try it from GnuCash.

@ -69,7 +69,7 @@ SCM scm_gnc_file_ofx_import ()
/* CS: Store the reference to the created importer gui so that the
ofx_proc_transaction_cb can use it. */
GNCGenTransaction *gnc_ofx_importer_gui = NULL;
GNCImportMainMatcher *gnc_ofx_importer_gui = NULL;
void gnc_file_ofx_import (void)
{

Loading…
Cancel
Save