mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2002-11-26 Christian Stimming <stimming@tuhh.de>
* src/import-export/gnc-gen-transaction.[hc] (gnc_gen_trans_get_fuzzy_amount): Add functions to get/set the fuzzy amount matching threshold, so that this feature can be used from gnc-ofx-import.c. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7556 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
5b70252b1a
commit
c701350d06
@ -1,3 +1,10 @@
|
||||
2002-11-26 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/import-export/gnc-gen-transaction.[hc]
|
||||
(gnc_gen_trans_get_fuzzy_amount): Add functions to get/set the
|
||||
fuzzy amount matching threshold, so that this feature can be used
|
||||
from gnc-ofx-import.c.
|
||||
|
||||
2002-11-25 Benoit Grégoire <bock@step.polymtl.ca>
|
||||
* src/import-export/hbci/gnc-hbci-gettrans.c: Remove
|
||||
#include "gnc-generic-import.h"
|
||||
|
@ -227,7 +227,6 @@ void gnc_import_TransInfo_delete (GNCImportTransInfo *info)
|
||||
\********************************************************************/
|
||||
|
||||
static short module = MOD_IMPORT;
|
||||
static const double MATCH_ATM_FEE_THRESHOLD=3.00;
|
||||
static const int MATCH_DATE_THRESHOLD=4; /*within 4 days*/
|
||||
static const int MATCH_DATE_NOT_THRESHOLD = 16;
|
||||
static const int SHOW_TRANSACTIONS_WITH_UNIQUE_ID = FALSE;
|
||||
|
@ -250,6 +250,7 @@ gnc_import_MatchInfo_get_split (const GNCImportMatchInfo * info);
|
||||
debugging purposes, otherwise all transactions of every accounts
|
||||
will be shown in the list */
|
||||
#define DEFAULT_DISPLAY_THRESHOLD 1
|
||||
#define MATCH_ATM_FEE_THRESHOLD 3.00
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -45,8 +45,8 @@ struct _generic_transaction_info
|
||||
int clear_threshold;
|
||||
int add_threshold;
|
||||
int display_threshold;
|
||||
|
||||
Account *source_acc;
|
||||
double fuzzy_amount_difference;
|
||||
/*Account *source_acc;*/
|
||||
};
|
||||
|
||||
/* The GtkCList widget has 7 columns. */
|
||||
@ -71,6 +71,18 @@ void gnc_gen_trans_delete (GNCGenTransaction *info)
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
void gnc_gen_trans_set_fuzzy_amount (GNCGenTransaction *info,
|
||||
double fuzzy_amount)
|
||||
{
|
||||
g_assert(info);
|
||||
info->fuzzy_amount_difference = fuzzy_amount;
|
||||
}
|
||||
double gnc_gen_trans_get_fuzzy_amount (const GNCGenTransaction *info)
|
||||
{
|
||||
g_assert(info);
|
||||
return info->fuzzy_amount_difference;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
on_matcher_ok_clicked (GtkButton *button,
|
||||
@ -387,7 +399,7 @@ void gnc_gen_trans_add_trans(GNCGenTransaction *gui, Transaction *trans)
|
||||
gui->clear_threshold,
|
||||
gui->clear_threshold,
|
||||
gui->display_threshold,
|
||||
0.0);
|
||||
gnc_gen_trans_get_fuzzy_amount (gui));
|
||||
|
||||
row_number = gtk_clist_append(GTK_CLIST (gui->clist),
|
||||
text_for_transInfo (transaction_info));
|
||||
|
@ -60,5 +60,13 @@ void gnc_gen_trans_freeze (GNCGenTransaction *gui);
|
||||
* transactions. */
|
||||
void gnc_gen_trans_thaw (GNCGenTransaction *gui);
|
||||
|
||||
/** Set the allowed amount range for fuzzy amount matching. */
|
||||
void gnc_gen_trans_set_fuzzy_amount (GNCGenTransaction *info,
|
||||
double fuzzy_amount);
|
||||
/** Return the allowed amount range for fuzzy amount matching. */
|
||||
double
|
||||
gnc_gen_trans_get_fuzzy_amount (const GNCGenTransaction *info);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -176,6 +176,7 @@ gnc_hbci_gettrans (GtkWidget *parent, Account *gnc_acc)
|
||||
|
||||
importer_gui = gnc_gen_trans_new (NULL, NULL);
|
||||
gnc_gen_trans_freeze (importer_gui);
|
||||
gnc_gen_trans_set_fuzzy_amount (importer_gui, 0.0);
|
||||
|
||||
{
|
||||
/* Now add the retrieved transactions to the gnucash account. */
|
||||
@ -207,16 +208,18 @@ static void *gnc_list_string_cb (const char *string, void *user_data)
|
||||
tmp1 = g_strdup (string);
|
||||
g_strstrip (tmp1);
|
||||
|
||||
if (*res != NULL) {
|
||||
/* The " " is the separating string in between each two strings. */
|
||||
tmp2 = g_strjoin (" ", *res, tmp1, NULL);
|
||||
g_free (tmp1);
|
||||
|
||||
g_free (*res);
|
||||
*res = tmp2;
|
||||
}
|
||||
else {
|
||||
*res = tmp1;
|
||||
if (strlen (tmp1) > 0) {
|
||||
if (*res != NULL) {
|
||||
/* The " " is the separating string in between each two strings. */
|
||||
tmp2 = g_strjoin (" ", *res, tmp1, NULL);
|
||||
g_free (tmp1);
|
||||
|
||||
g_free (*res);
|
||||
*res = tmp2;
|
||||
}
|
||||
else {
|
||||
*res = tmp1;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -293,7 +296,7 @@ static void *trans_list_cb (const HBCI_Transaction *h_trans,
|
||||
DEBUG("HBCI Description '%s'", h_descr);
|
||||
|
||||
g_descr =
|
||||
((strlen (h_descr) > 0) ?
|
||||
((h_descr && (strlen (h_descr) > 0)) ?
|
||||
g_strdup_printf ("%s; %s",
|
||||
h_descr,
|
||||
othername) :
|
||||
|
@ -53,6 +53,7 @@
|
||||
|
||||
|
||||
static short module = MOD_IMPORT;
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_file_ofx_import
|
||||
* Entry point
|
||||
@ -104,6 +105,9 @@ void gnc_file_ofx_import (void)
|
||||
|
||||
/* CS: Create the Generic transaction importer GUI. */
|
||||
gnc_ofx_importer_gui = gnc_gen_trans_new(NULL, NULL);
|
||||
/* Set the allowed fuzzy amount difference to something higher than zero. */
|
||||
gnc_gen_trans_set_fuzzy_amount (gnc_ofx_importer_gui,
|
||||
MATCH_ATM_FEE_THRESHOLD);
|
||||
DEBUG("Opening selected file");
|
||||
ofx_proc_file(2, filenames);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user