mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Improved date heuristics (punishment if dates are very very far apart).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7522 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
a92e78fad9
commit
7aa201168a
@ -148,8 +148,8 @@ struct _matchinfo
|
|||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
static short module = MOD_IMPORT;
|
static short module = MOD_IMPORT;
|
||||||
static const double MATCH_ATM_FEE_TRESHOLD=3.00;
|
static const double MATCH_ATM_FEE_THRESHOLD=3.00;
|
||||||
static const int MATCH_DATE_TRESHOLD=4; /*within 4 days*/
|
static const int MATCH_DATE_THRESHOLD=4; /*within 4 days*/
|
||||||
static const int SHOW_TRANSACTIONS_WITH_UNIQUE_ID = FALSE;
|
static const int SHOW_TRANSACTIONS_WITH_UNIQUE_ID = FALSE;
|
||||||
static const int SHOW_NUMERIC_SCORE = FALSE;
|
static const int SHOW_NUMERIC_SCORE = FALSE;
|
||||||
|
|
||||||
@ -823,7 +823,7 @@ static void split_find_match( struct _transmatcherdialog * matcher,
|
|||||||
match_info->probability=match_info->probability+3;
|
match_info->probability=match_info->probability+3;
|
||||||
DEBUG("heuristics: probability + 3 (amount)");
|
DEBUG("heuristics: probability + 3 (amount)");
|
||||||
}
|
}
|
||||||
else if(fabs(downloaded_split_amount-match_split_amount)<=MATCH_ATM_FEE_TRESHOLD)
|
else if(fabs(downloaded_split_amount-match_split_amount)<=MATCH_ATM_FEE_THRESHOLD)
|
||||||
{
|
{
|
||||||
/* ATM fees are sometimes added directly in the transaction. So you withdraw 100$ and get charged 101,25$
|
/* ATM fees are sometimes added directly in the transaction. So you withdraw 100$ and get charged 101,25$
|
||||||
in the same transaction */
|
in the same transaction */
|
||||||
@ -851,11 +851,19 @@ static void split_find_match( struct _transmatcherdialog * matcher,
|
|||||||
match_info->probability=match_info->probability+2;
|
match_info->probability=match_info->probability+2;
|
||||||
DEBUG("heuristics: probability + 2 (date)");
|
DEBUG("heuristics: probability + 2 (date)");
|
||||||
}
|
}
|
||||||
else if (datediff_day <= MATCH_DATE_TRESHOLD)
|
else if (datediff_day <= MATCH_DATE_THRESHOLD)
|
||||||
{
|
{
|
||||||
match_info->probability=match_info->probability+1;
|
match_info->probability=match_info->probability+1;
|
||||||
DEBUG("heuristics: probability + 1 (date)");
|
DEBUG("heuristics: probability + 1 (date)");
|
||||||
}
|
}
|
||||||
|
else if (datediff_day > 4*MATCH_DATE_THRESHOLD)
|
||||||
|
{
|
||||||
|
/* ok, the factor '4' here is kind of arbitrary. Anyway,
|
||||||
|
there needs to be extra punishment if this transaction
|
||||||
|
lies awfully far away from this one. */
|
||||||
|
match_info->probability=match_info->probability-1;
|
||||||
|
DEBUG("heuristics: probability - 1 (date)");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Memo heuristics */
|
/* Memo heuristics */
|
||||||
|
Loading…
Reference in New Issue
Block a user