mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2004-10-08 Benoit Gr�goire <bock@step.polymtl.ca>
* src/import-export/import-backend.c: Duplicate match tweaks:
-Change MATCH_DATE_NOT_THRESHOLD from 3 weeks to two weeks
-A transaction amount mismatch past the threshold is now punished by -5 instead of -1
-Date mismatch is now worth -5 isntead of -10
-Check number mismatch is now punished -2, but only if both numbers are NOT empty.
* src/import-export/ofx/gnc-ofx-import.c: Update for new LibOfx, this among other things, gives gnucash Microsoft OFC support.
* src/import-export/ofx/test/test-link.cL Update for new LibOfx.
* configure.in: Partly update for new libofx. It will crash if the right version isn't available, but there is no explicit version support (if someone wants to code it, you can use the output of "ofxdump --version".
* src/gnome-utils/gnc-query-list.c: Fix gcc3.4 compile problem
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10299 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
12
ChangeLog
12
ChangeLog
@@ -1,3 +1,15 @@
|
||||
2004-10-08 Benoit Gr<47>goire <bock@step.polymtl.ca>
|
||||
* src/import-export/import-backend.c: Duplicate match tweaks:
|
||||
-Change MATCH_DATE_NOT_THRESHOLD from 3 weeks to two weeks
|
||||
-A transaction amount mismatch past the threshold is now punished by -5 instead of -1
|
||||
-Date mismatch is now worth -5 isntead of -10
|
||||
-Check number mismatch is now punished -2, but only if both numbers are NOT empty.
|
||||
* src/import-export/ofx/gnc-ofx-import.c: Update for new LibOfx, this among other things, gives gnucash Microsoft OFC support.
|
||||
* src/import-export/ofx/test/test-link.cL Update for new LibOfx.
|
||||
* configure.in: Partly update for new libofx. It will crash if the right version isn't available, but there is no explicit version support (if someone wants to code it, you can use the output of "ofxdump --version".
|
||||
* src/gnome-utils/gnc-query-list.c: Fix gcc3.4 compile problem
|
||||
|
||||
|
||||
2004-09-30 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/import-export/hbci/gnc-hbci-getbalance.c: Fix HBCI balance
|
||||
|
||||
@@ -549,13 +549,9 @@ then
|
||||
LIBS="${LIBS} ${LIBOFX_LIBS}"
|
||||
AC_TRY_LINK( [
|
||||
#include <libofx/libofx.h>
|
||||
int ofx_proc_status_cb(const struct OfxStatusData data) { return 0; }
|
||||
int ofx_proc_account_cb(const struct OfxAccountData data) { return 0; }
|
||||
int ofx_proc_security_cb(const struct OfxSecurityData data) { return 0; }
|
||||
int ofx_proc_transaction_cb(const struct OfxTransactionData data) { return 0; }
|
||||
int ofx_proc_statement_cb(const struct OfxStatementData data) { return 0; }
|
||||
], [
|
||||
ofx_proc_file(0, NULL);
|
||||
LibofxContextPtr libofx_context = libofx_get_new_context();
|
||||
libofx_free_context(libofx_context);
|
||||
], AC_MSG_RESULT(yes),
|
||||
[ AC_MSG_ERROR([*** Cannot compile test program for libofx library. Please check config.log for the exact error.]) ] )
|
||||
|
||||
|
||||
@@ -764,6 +764,7 @@ gnc_query_list_fill(GNCQueryList *list)
|
||||
gchar *strings[list->num_columns + 1];
|
||||
GList *entries, *item;
|
||||
const GUID *guid;
|
||||
const QofParam *gup;
|
||||
gint i;
|
||||
|
||||
/* Clear all watches */
|
||||
@@ -828,7 +829,7 @@ gnc_query_list_fill(GNCQueryList *list)
|
||||
update_booleans (list, row);
|
||||
|
||||
/* and set a watcher on this item */
|
||||
const QofParam *gup = list->priv->get_guid;
|
||||
gup = list->priv->get_guid;
|
||||
guid = (const GUID*)((gup->param_getfcn)(item->data, gup));
|
||||
gnc_gui_component_watch_entity (list->priv->component_id, guid,
|
||||
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
|
||||
|
||||
@@ -58,7 +58,7 @@ static short module = MOD_IMPORT;
|
||||
\********************************************************************/
|
||||
|
||||
static const int MATCH_DATE_THRESHOLD=4; /*within 4 days*/
|
||||
static const int MATCH_DATE_NOT_THRESHOLD = 21;
|
||||
static const int MATCH_DATE_NOT_THRESHOLD = 14;
|
||||
/**Transaction's who have an online_id kvp frame have been downloaded
|
||||
online can probably be skipped in the match list, since it is very
|
||||
unlikely that they would match a transaction downloaded at a later
|
||||
@@ -615,8 +615,8 @@ static void split_find_match (GNCImportTransInfo * trans_info,
|
||||
{
|
||||
/* If a transaction's amount doesn't match within the
|
||||
threshold, it's very unlikely to be the same transaction
|
||||
so we give it an extra -1 penality */
|
||||
prob = prob-1;
|
||||
so we give it an extra -5 penality */
|
||||
prob = prob-5;
|
||||
/* DEBUG("heuristics: probability - 1 (amount)"); */
|
||||
}
|
||||
|
||||
@@ -645,8 +645,8 @@ static void split_find_match (GNCImportTransInfo * trans_info,
|
||||
{
|
||||
/* Extra penalty if that split lies awfully far away
|
||||
from the given one. */
|
||||
prob = prob-10;
|
||||
/*DEBUG("heuristics: probability - 10 (date)"); */
|
||||
prob = prob-5;
|
||||
/*DEBUG("heuristics: probability - 5 (date)"); */
|
||||
}
|
||||
|
||||
/* Check number heuristics */
|
||||
@@ -657,10 +657,16 @@ static void split_find_match (GNCImportTransInfo * trans_info,
|
||||
xaccTransGetNum(xaccSplitGetParent(split)))
|
||||
==0))
|
||||
{
|
||||
/*An exact match of the Check number gives a +5 */
|
||||
prob = prob+5;
|
||||
/*An exact match of the Check number gives a +4 */
|
||||
prob = prob+4;
|
||||
/*DEBUG("heuristics: probability + 5 (Check number)");*/
|
||||
}
|
||||
else if(strlen(xaccTransGetNum(gnc_import_TransInfo_get_trans (trans_info))) > 0 &&
|
||||
strlen(xaccTransGetNum(xaccSplitGetParent(split))) > 0)
|
||||
{
|
||||
/* If both number are not empty yet do not match, add a little extre penality */
|
||||
prob = prob-2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Memo heuristics */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/********************************************************************\
|
||||
/*******************************************************************\
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
@@ -72,64 +72,18 @@ SCM scm_gnc_file_ofx_import ()
|
||||
ofx_proc_transaction_cb can use it. */
|
||||
GNCImportMainMatcher *gnc_ofx_importer_gui = NULL;
|
||||
|
||||
void gnc_file_ofx_import (void)
|
||||
{
|
||||
extern int ofx_PARSER_msg;
|
||||
extern int ofx_DEBUG_msg;
|
||||
extern int ofx_WARNING_msg;
|
||||
extern int ofx_ERROR_msg;
|
||||
extern int ofx_INFO_msg;
|
||||
extern int ofx_STATUS_msg;
|
||||
char *filenames[3];
|
||||
const char *selected_filename;
|
||||
char *default_dir;
|
||||
|
||||
ofx_PARSER_msg = false;
|
||||
ofx_DEBUG_msg = false;
|
||||
ofx_WARNING_msg = true;
|
||||
ofx_ERROR_msg = true;
|
||||
ofx_INFO_msg = true;
|
||||
ofx_STATUS_msg = false;
|
||||
|
||||
gnc_set_log_level(MOD_IMPORT, GNC_LOG_TRACE);
|
||||
ENTER(" ");
|
||||
|
||||
default_dir = gnc_lookup_string_option("__paths", "Import OFX", NULL);
|
||||
if (default_dir == NULL)
|
||||
gnc_init_default_directory(&default_dir);
|
||||
selected_filename = gnc_file_dialog(_("Select an OFX/QFX file to process"),
|
||||
NULL,
|
||||
default_dir);
|
||||
|
||||
if(selected_filename!=NULL)
|
||||
{
|
||||
/* Remember the directory as the default. */
|
||||
gnc_extract_directory(&default_dir, selected_filename);
|
||||
gnc_set_string_option("__paths", "Import OFX", default_dir);
|
||||
g_free(default_dir);
|
||||
|
||||
/*strncpy(file,selected_filename, 255);*/
|
||||
DEBUG("Filename found: %s",selected_filename);
|
||||
filenames[0]=NULL;
|
||||
filenames[1]= (char *)selected_filename;
|
||||
/* filenames[1]=file;*/
|
||||
filenames[2]=NULL;
|
||||
|
||||
/* Create the Generic transaction importer GUI. */
|
||||
gnc_ofx_importer_gui = gnc_gen_trans_list_new(NULL, NULL, FALSE);
|
||||
|
||||
DEBUG("Opening selected file");
|
||||
ofx_proc_file(2, filenames);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
int ofx_proc_status_cb(struct OfxStatusData data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int ofx_proc_security_cb(const struct OfxSecurityData data)
|
||||
int ofx_proc_security_cb(const struct OfxSecurityData data, void * security_user_data);
|
||||
int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_user_data);
|
||||
int ofx_proc_account_cb(struct OfxAccountData data, void * account_user_data);
|
||||
|
||||
int ofx_proc_security_cb(const struct OfxSecurityData data, void * security_user_data)
|
||||
{
|
||||
char * tmp_exchange_code=NULL;
|
||||
char * tmp_default_fullname=NULL;
|
||||
@@ -155,7 +109,7 @@ int ofx_proc_security_cb(const struct OfxSecurityData data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ofx_proc_transaction_cb(struct OfxTransactionData data)
|
||||
int ofx_proc_transaction_cb(struct OfxTransactionData data, void * transaction_user_data)
|
||||
{
|
||||
char dest_string[255];
|
||||
time_t current_time;
|
||||
@@ -563,12 +517,14 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data)
|
||||
return 0;
|
||||
}//end ofx_proc_transaction()
|
||||
|
||||
int ofx_proc_statement_cb(struct OfxStatementData data)
|
||||
/*
|
||||
int ofx_proc_statement_cb(struct OfxStatementData data, void * statement_user_data)
|
||||
{
|
||||
return 0;
|
||||
}//end ofx_proc_statement()
|
||||
*/
|
||||
|
||||
int ofx_proc_account_cb(struct OfxAccountData data)
|
||||
int ofx_proc_account_cb(struct OfxAccountData data, void * account_user_data)
|
||||
{
|
||||
Account *selected_account;
|
||||
gnc_commodity_table * commodity_table;
|
||||
@@ -646,4 +602,62 @@ int ofx_proc_account_cb(struct OfxAccountData data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void gnc_file_ofx_import (void)
|
||||
{
|
||||
extern int ofx_PARSER_msg;
|
||||
extern int ofx_DEBUG_msg;
|
||||
extern int ofx_WARNING_msg;
|
||||
extern int ofx_ERROR_msg;
|
||||
extern int ofx_INFO_msg;
|
||||
extern int ofx_STATUS_msg;
|
||||
const char *selected_filename;
|
||||
char *default_dir;
|
||||
LibofxContextPtr libofx_context = libofx_get_new_context();
|
||||
|
||||
ofx_PARSER_msg = false;
|
||||
ofx_DEBUG_msg = false;
|
||||
ofx_WARNING_msg = true;
|
||||
ofx_ERROR_msg = true;
|
||||
ofx_INFO_msg = true;
|
||||
ofx_STATUS_msg = false;
|
||||
|
||||
gnc_should_log(MOD_IMPORT, GNC_LOG_TRACE);
|
||||
DEBUG("gnc_file_ofx_import(): Begin...\n");
|
||||
|
||||
default_dir = gnc_lookup_string_option("__paths", "Import OFX", NULL);
|
||||
if (default_dir == NULL)
|
||||
gnc_init_default_directory(&default_dir);
|
||||
selected_filename = gnc_file_dialog(_("Select an OFX/QFX file to process"),
|
||||
NULL,
|
||||
default_dir);
|
||||
|
||||
if(selected_filename!=NULL)
|
||||
{
|
||||
/* Remember the directory as the default. */
|
||||
gnc_extract_directory(&default_dir, selected_filename);
|
||||
gnc_set_string_option("__paths", "Import OFX", default_dir);
|
||||
g_free(default_dir);
|
||||
|
||||
/*strncpy(file,selected_filename, 255);*/
|
||||
DEBUG("Filename found: %s",selected_filename);
|
||||
|
||||
/* Create the Generic transaction importer GUI. */
|
||||
gnc_ofx_importer_gui = gnc_gen_trans_list_new(NULL, NULL, FALSE);
|
||||
|
||||
/* Initialize libofx */
|
||||
|
||||
/*ofx_set_statement_cb(libofx_context, ofx_proc_statement_cb, 0);*/
|
||||
ofx_set_account_cb(libofx_context, ofx_proc_account_cb, 0);
|
||||
ofx_set_transaction_cb(libofx_context, ofx_proc_transaction_cb, 0);
|
||||
ofx_set_security_cb(libofx_context, ofx_proc_security_cb, 0);
|
||||
/*ofx_set_status_cb(libofx_context, ofx_proc_status_cb, 0);*/
|
||||
|
||||
|
||||
DEBUG("Opening selected file");
|
||||
libofx_proc_file(libofx_context, selected_filename, AUTODETECT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** @} */
|
||||
|
||||
@@ -5,23 +5,3 @@ main(int argc, char ** argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ofx_proc_status_cb(struct OfxStatusData data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int ofx_proc_security_cb(struct OfxSecurityData data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int ofx_proc_transaction_cb(struct OfxTransactionData data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int ofx_proc_statement_cb(struct OfxStatementData data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int ofx_proc_account_cb(struct OfxAccountData data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user