GnuCash
4.11-11-ge9df8d41d2+
|
Modules | |
AqBanking | |
Files | |
file | import-account-matcher.h |
Generic and very flexible account matcher/picker. | |
file | import-backend.h |
Generic importer backend interface. | |
file | import-commodity-matcher.h |
A Generic commodity matcher/picker. | |
file | import-main-matcher.h |
Transaction matcher main window. | |
file | import-match-picker.h |
The transaction match picker dialog interface. | |
file | import-pending-matches.h |
Tracking container for pending match status. | |
file | import-settings.h |
Import preference handling. | |
file | import-utilities.h |
Utility functions for writing import modules. | |
Data Structures | |
struct | AccountOnlineMatch |
struct | AccountPickerDialog |
struct | GNCImportSelectedMatchInfo |
struct | GNCImportTransInfo |
struct | GNCImportMatchInfo |
struct | GNCImportMainMatcher |
struct | match_struct |
struct | GNCImportMatchPicker |
struct | GNCPendingMatches |
struct | GNCImportSettings |
struct | split_record |
struct | ofx_info |
Macros | |
#define | STATE_SECTION "dialogs/import/generic_matcher/account_matcher" |
#define | GNC_PREFS_GROUP "dialogs.import.generic.account-picker" |
#define | GNCIMPORT_DESC "desc" |
#define | GNCIMPORT_MEMO "memo" |
#define | GNCIMPORT_PAYEE "payee" |
#define | GNC_PREFS_GROUP "dialogs.import.generic.transaction-list" |
#define | IMPORT_MAIN_MATCHER_CM_CLASS "transaction-matcher-dialog" |
#define | CSS_INT_REQUIRED_CLASS "gnc-class-intervention-required" |
#define | CSS_INT_PROB_REQUIRED_CLASS "gnc-class-intervention-probably-required" |
#define | CSS_INT_NOT_REQUIRED_CLASS "gnc-class-intervention-not-required" |
#define | G_MOD_IMPORT_MATCHER "gnc.import.main-matcher" |
#define | GNC_PREFS_GROUP "dialogs.import.generic.match-picker" |
#define | GNC_PREF_DISPLAY_RECONCILED "display-reconciled" |
#define | GNC_PREFS_GROUP_IMPORT "dialogs.import.generic" |
The preferences used by the importer. | |
#define | GNC_PREF_ENABLE_SKIP "enable-skip" |
#define | GNC_PREF_ENABLE_UPDATE "enable-update" |
#define | GNC_PREF_USE_BAYES "use-bayes" |
#define | GNC_PREF_ATM_FEE_THRESHOLD "atm-fee-threshold" |
#define | GNC_PREF_AUTO_CLEAR_THRESHOLD "auto-clear-threshold" |
#define | GNC_PREF_AUTO_ADD_THRESHOLD "auto-add-threshold" |
#define | GNC_PREF_MATCH_THRESHOLD "match-threshold" |
#define | GNC_PREF_MATCH_DATE_THRESHOLD "match-date-threshold" |
#define | GNC_PREF_MATCH_DATE_NOT_THRESHOLD "match-date-not-threshold" |
#define | GNC_PREFS_GROUP "dialogs.log-replay" |
#define | STRING_FIELD_SIZE 256 |
#define | GNC_PREFS_GROUP "dialogs.import.ofx" |
#define | GNC_PREF_AUTO_COMMODITY "auto-create-commodity" |
Typedefs | |
typedef void(* | GNCTransactionProcessedCB) (GNCImportTransInfo *trans_info, gboolean imported, gpointer user_data) |
typedef GHashTable | GNCImportPendingMatches |
Functions | |
Account * | gnc_import_select_account (GtkWidget *parent, const gchar *account_online_id_value, gboolean auto_create, const gchar *account_human_description, const gnc_commodity *new_account_default_commodity, GNCAccountType new_account_default_type, Account *default_selection, gboolean *ok_pressed) |
Must be called with a string containing a unique identifier for the account. More... | |
gnc_commodity * | gnc_import_select_commodity (const char *cusip, gboolean ask_on_unknown, const char *default_fullname, const char *default_mnemonic) |
Must be called with a string containing a unique identifier for the commodity. More... | |
void | on_matcher_ok_clicked (GtkButton *button, GNCImportMainMatcher *info) |
void | on_matcher_cancel_clicked (GtkButton *button, gpointer user_data) |
gboolean | on_matcher_delete_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
void | on_matcher_help_clicked (GtkButton *button, gpointer user_data) |
This allows for the transaction help dialog to be started from the assistant button callback. More... | |
void | on_matcher_help_close_clicked (GtkButton *button, gpointer user_data) |
void | gnc_gen_trans_list_delete (GNCImportMainMatcher *info) |
Deletes the given object. More... | |
gboolean | gnc_gen_trans_list_empty (GNCImportMainMatcher *info) |
Checks whether there are no transactions to match. More... | |
void | gnc_gen_trans_list_show_all (GNCImportMainMatcher *info) |
Shows widgets. More... | |
GNCImportMainMatcher * | gnc_gen_trans_list_new (GtkWidget *parent, const gchar *heading, gboolean all_from_same_account, gint match_date_hardlimit, gboolean show_all) |
Create a new generic transaction dialog window and return it. More... | |
GNCImportMainMatcher * | gnc_gen_trans_assist_new (GtkWidget *parent, GtkWidget *assistant_page, const gchar *heading, gboolean all_from_same_account, gint match_date_hardlimit) |
Add the Transaction matcher to an existing page of an assistant. More... | |
void | gnc_gen_trans_assist_start (GNCImportMainMatcher *info) |
This starts the import process for transaction from an assistant. More... | |
void | gnc_gen_trans_list_add_tp_cb (GNCImportMainMatcher *info, GNCTransactionProcessedCB trans_processed_cb, gpointer user_data) |
Add transaction processed callback to the transaction importer. More... | |
gboolean | gnc_gen_trans_list_run (GNCImportMainMatcher *info) |
Run this dialog and return only after the user pressed Ok, Cancel, or closed the window. More... | |
void | gnc_gen_trans_list_add_trans (GNCImportMainMatcher *gui, Transaction *trans) |
Add a newly imported Transaction to the Transaction Importer. More... | |
void | gnc_gen_trans_list_show_reconcile_after_close_button (GNCImportMainMatcher *info, gboolean reconcile_after_close, gboolean active) |
Show and set the reconcile after close check button. More... | |
GtkWidget * | gnc_gen_trans_list_get_reconcile_after_close_button (GNCImportMainMatcher *info) |
Returns the reconcile after close check button. More... | |
void | gnc_gen_trans_list_add_trans_with_ref_id (GNCImportMainMatcher *gui, Transaction *trans, guint32 ref_id) |
Add a newly imported Transaction to the Transaction Importer and provide an external reference id for it. More... | |
GtkWidget * | gnc_gen_trans_list_widget (GNCImportMainMatcher *info) |
Returns the widget of this dialog. More... | |
GtkWidget * | gnc_gen_trans_list_append_text_widget (GNCImportMainMatcher *info) |
Returns the append_text widget of this dialog. More... | |
void | gnc_import_match_picker_run_and_close (GtkWidget *parent, GNCImportTransInfo *transaction_info, GNCImportPendingMatches *pending_matches) |
Run a match_picker dialog so that the selected-MatchInfo in the given trans_info is updated accordingly. More... | |
GNCImportPendingMatches * | gnc_import_PendingMatches_new (void) |
void | gnc_import_PendingMatches_delete (GNCImportPendingMatches *map) |
void | gnc_import_PendingMatches_add_match (GNCImportPendingMatches *map, GNCImportMatchInfo *match_info, gboolean selected_manually) |
void | gnc_import_PendingMatches_remove_match (GNCImportPendingMatches *map, GNCImportMatchInfo *match_info, gboolean selected_manually) |
GNCImportPendingMatchType | gnc_import_PendingMatches_get_match_type (GNCImportPendingMatches *map, GNCImportMatchInfo *match_info) |
const char * | gnc_import_PendingMatches_get_type_str (GNCImportPendingMatchType type) |
GNCImportSettings * | gnc_import_Settings_new (void) |
Allocates a new GNCImportSettings object, and initialize it with the appropriate user prefs. | |
void | gnc_import_Settings_delete (GNCImportSettings *settings) |
Destructor. | |
gboolean | gnc_import_trans_has_online_id (Transaction *transaction) |
gboolean | gnc_import_split_has_online_id (Split *split) |
void | qof_instance_set_guid (gpointer inst, const GncGUID *guid) |
Set the GncGUID of this instance. | |
void | gnc_file_log_replay (GtkWindow *parent) |
The gnc_file_log_replay() routine will pop up a standard file selection dialogue asking the user to pick a log file to replay. More... | |
int | ofx_proc_statement_cb (struct OfxStatementData data, void *statement_user_data) |
int | ofx_proc_security_cb (const struct OfxSecurityData data, void *security_user_data) |
int | ofx_proc_transaction_cb (struct OfxTransactionData data, void *user_data) |
int | ofx_proc_account_cb (struct OfxAccountData data, void *account_user_data) |
void | gnc_file_ofx_import (GtkWindow *parent) |
The gnc_file_ofx_import() routine will pop up a standard file selection dialogue asking the user to pick a OFX/QFX file. More... | |
char * | libgncmod_ofx_gnc_module_path (void) |
char * | libgncmod_ofx_gnc_module_description (void) |
int | libgncmod_ofx_gnc_module_init (int refcount) |
int | libgncmod_ofx_gnc_module_end (int refcount) |
Non-GUI Functions | |
GdkPixbuf * | gen_probability_pixbuf (gint score, GNCImportSettings *settings, GtkWidget *widget) |
This function generates a new pixmap representing a match score. More... | |
void | split_find_match (GNCImportTransInfo *trans_info, Split *split, gint display_threshold, gint date_threshold, gint date_not_threshold, double fuzzy_amount_difference) |
The transaction matching heuristics are here. More... | |
gboolean | gnc_import_process_trans_item (GncImportMatchMap *matchmap, GNCImportTransInfo *trans_info) |
/brief – Processes one match according to its selected action. More... | |
gboolean | gnc_import_exists_online_id (Transaction *trans, GHashTable *acct_id_hash) |
Checks whether the given transaction's online_id already exists in its parent account. More... | |
void | gnc_import_TransInfo_init_matches (GNCImportTransInfo *trans_info, GNCImportSettings *settings) |
Iterates through all splits of the originating account of trans_info. More... | |
Getters/Setters for GNCImportTransInfo | |
GList * | gnc_import_TransInfo_get_match_list (const GNCImportTransInfo *info) |
Returns the stored list of possible matches. More... | |
void | gnc_import_TransInfo_set_match_list (GNCImportTransInfo *info, GList *match_list) |
Assigns the list of possible matches. More... | |
Transaction * | gnc_import_TransInfo_get_trans (const GNCImportTransInfo *info) |
Returns the transaction of this TransInfo. More... | |
gboolean | gnc_import_TransInfo_is_balanced (const GNCImportTransInfo *info) |
Returns if the transaction stored in the TransInfo is currently balanced. More... | |
Split * | gnc_import_TransInfo_get_fsplit (const GNCImportTransInfo *info) |
Returns the first split of the transaction of this TransInfo. More... | |
GNCImportMatchInfo * | gnc_import_TransInfo_get_selected_match (const GNCImportTransInfo *info) |
Returns the currently selected match in this TransInfo. More... | |
void | gnc_import_TransInfo_set_selected_match_info (GNCImportTransInfo *info, GNCImportMatchInfo *match, gboolean selected_manually) |
Sets the currently selected match in this TransInfo. More... | |
gboolean | gnc_import_TransInfo_get_match_selected_manually (const GNCImportTransInfo *info) |
Returns if the currently selected match was selected by the user. More... | |
GNCImportAction | gnc_import_TransInfo_get_action (const GNCImportTransInfo *info) |
Returns the currently selected action for this TransInfo. More... | |
void | gnc_import_TransInfo_set_action (GNCImportTransInfo *info, GNCImportAction action) |
Set the action for this TransInfo. More... | |
Account * | gnc_import_TransInfo_get_destacc (const GNCImportTransInfo *info) |
Returns the 'other account' of this transaction. More... | |
void | gnc_import_TransInfo_set_destacc (GNCImportTransInfo *info, Account *acc, gboolean selected_manually) |
Set the 'other account' of this transaction (used for auto-balance if needed). More... | |
gboolean | gnc_import_TransInfo_get_destacc_selected_manually (const GNCImportTransInfo *info) |
Returns if the currently selected destination account for auto-matching was selected by the user. More... | |
guint32 | gnc_import_TransInfo_get_ref_id (const GNCImportTransInfo *info) |
Returns the reference id for this TransInfo. More... | |
void | gnc_import_TransInfo_set_ref_id (GNCImportTransInfo *info, guint32 ref_id) |
Set the reference id for this TransInfo. More... | |
void | gnc_import_TransInfo_set_append_text (GNCImportTransInfo *info, gboolean append_text) |
Set the append_text for this TransInfo. More... | |
void | gnc_import_TransInfo_delete (GNCImportTransInfo *info) |
Destructor. | |
GNCImportTransInfo * | gnc_import_TransInfo_new (Transaction *trans, GncImportMatchMap *matchmap) |
Create a new object of GNCImportTransInfo here. More... | |
gboolean | gnc_import_TransInfo_refresh_destacc (GNCImportTransInfo *transaction_info, GncImportMatchMap *matchmap) |
Try to automatch a given transaction to a destination account. | |
Getters/Setters for GNCImportMatchInfo | |
Split * | gnc_import_MatchInfo_get_split (const GNCImportMatchInfo *info) |
Get the split ('this-side split') of this MatchInfo. More... | |
gint | gnc_import_MatchInfo_get_probability (const GNCImportMatchInfo *info) |
Get the probability (confidence level) of this MatchInfo. More... | |
Getters/Setters for GNCImportSettings | |
double | gnc_import_Settings_get_fuzzy_amount (GNCImportSettings *settings) |
Return the allowed amount range for fuzzy amount matching. More... | |
gboolean | gnc_import_Settings_get_action_skip_enabled (GNCImportSettings *settings) |
Return the selected action is enable state. | |
gboolean | gnc_import_Settings_get_action_add_enabled (GNCImportSettings *settings) |
Return the selected action is enable state. | |
gboolean | gnc_import_Settings_get_action_update_enabled (GNCImportSettings *settings) |
Return the selected action is enable state. | |
gboolean | gnc_import_Settings_get_action_clear_enabled (GNCImportSettings *settings) |
Return the selected action is enable state. | |
gint | gnc_import_Settings_get_clear_threshold (GNCImportSettings *settings) |
Return the selected threshold. | |
gint | gnc_import_Settings_get_add_threshold (GNCImportSettings *settings) |
Return the selected threshold. | |
gint | gnc_import_Settings_get_display_threshold (GNCImportSettings *settings) |
Return the selected threshold. | |
gint | gnc_import_Settings_get_date_threshold (GNCImportSettings *settings) |
gint | gnc_import_Settings_get_date_not_threshold (GNCImportSettings *settings) |
void | gnc_import_Settings_set_match_date_hardlimit (GNCImportSettings *s, gint m) |
gint | gnc_import_Settings_get_match_date_hardlimit (const GNCImportSettings *settings) |
Returns the hard-limiting number of days that a matching split may differ. More... | |
Setter-getters | |
Setter and getter functions for the online_id field for Splits. | |
const gchar * | gnc_import_get_acc_online_id (Account *account) |
void | gnc_import_set_acc_online_id (Account *account, const gchar *id) |
const gchar * | gnc_import_get_trans_online_id (Transaction *transaction) |
void | gnc_import_set_trans_online_id (Transaction *transaction, const gchar *id) |
const gchar * | gnc_import_get_split_online_id (Split *split) |
void | gnc_import_set_split_online_id (Split *split, const gchar *id) |
GdkPixbuf * gen_probability_pixbuf | ( | gint | score, |
GNCImportSettings * | settings, | ||
GtkWidget * | widget | ||
) |
This function generates a new pixmap representing a match score.
It is a series of vertical bars of different colors. -Below or at the add_threshold the bars are red -Above or at the clear_threshold the bars are green -Between the two threshold the bars are yellow
score | The score for which to generate a pixmap. |
settings | The user settings from which to get the threshold |
widget | The parent widget in which the pixmap will eventually be added. Will be used to generate the colormap. |
Definition at line 299 of file import-backend.c.
void gnc_file_log_replay | ( | GtkWindow * | parent | ) |
The gnc_file_log_replay() routine will pop up a standard file selection dialogue asking the user to pick a log file to replay.
If one is selected the .log file is opened and read. Its contents are then silently merged in the current log file.
Definition at line 548 of file gnc-log-replay.c.
void gnc_file_ofx_import | ( | GtkWindow * | parent | ) |
The gnc_file_ofx_import() routine will pop up a standard file selection dialogue asking the user to pick a OFX/QFX file.
If one is selected the OFX file is opened and read. Its contents are merged into the existing session (if any). The current session continues to remain open for editing.
Definition at line 1368 of file gnc-ofx-import.c.
GNCImportMainMatcher * gnc_gen_trans_assist_new | ( | GtkWidget * | parent, |
GtkWidget * | assistant_page, | ||
const gchar * | heading, | ||
gboolean | all_from_same_account, | ||
gint | match_date_hardlimit | ||
) |
Add the Transaction matcher to an existing page of an assistant.
Must be called with the parent widget, ie. a vbox that the transaction matcher will be packed into. The data structure GNCImportMainMatcher is returned.
parent | The parent widget |
assistant_page | The parent widget. This is the place the transaction matcher will be packed into. |
heading | The heading label in the Importer window. May be NULL. |
all_from_same_account | Set this to TRUE if ALL the transaction 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. |
match_date_hardlimit | The number of days that a matching split may differ from the given transaction before it is discarded immediately. In other words, any split that is more distant from the given transaction than this match_date_hardlimit days will be ignored altogether. For use cases without paper checks (e.g. HBCI), values like 14 (days) might be appropriate, whereas for use cases with paper checks (e.g. OFX, QIF), values like 42 (days) seem more appropriate. |
Definition at line 1481 of file import-main-matcher.c.
void gnc_gen_trans_assist_start | ( | GNCImportMainMatcher * | info | ) |
This starts the import process for transaction from an assistant.
assistant button callback.
info. | A pointer to the GNCImportMainMatcher structure |
Definition at line 1511 of file import-main-matcher.c.
void gnc_gen_trans_list_add_tp_cb | ( | GNCImportMainMatcher * | info, |
GNCTransactionProcessedCB | trans_processed_cb, | ||
gpointer | user_data | ||
) |
Add transaction processed callback to the transaction importer.
info | The Transaction Importer to use. |
trans_processed_cb | The callback function. |
Definition at line 1521 of file import-main-matcher.c.
void gnc_gen_trans_list_add_trans | ( | GNCImportMainMatcher * | gui, |
Transaction * | trans | ||
) |
Add a newly imported Transaction to the Transaction Importer.
The Importer takes over ownership of the passed transaction.
gui | The Transaction Importer to use. |
trans | The Transaction to add. The must contain at least one split, and this split must have been associated with an account Only the first split will be used for matching. The transaction must NOT be committed. The Importer takes over ownership of the passed transaction. |
Definition at line 1905 of file import-main-matcher.c.
void gnc_gen_trans_list_add_trans_with_ref_id | ( | GNCImportMainMatcher * | gui, |
Transaction * | trans, | ||
guint32 | ref_id | ||
) |
Add a newly imported Transaction to the Transaction Importer and provide an external reference id for it.
The Importer takes over ownership of the passed transaction.
gui | The Transaction Importer to use. |
trans | The Transaction to add. The must contain at least one split, and this split must have been associated with an account Only the first split will be used for matching. The transaction must NOT be committed. The Importer takes over ownership of the passed transaction. |
ref_id | Reference id which links an external object to the transaction. |
Definition at line 1935 of file import-main-matcher.c.
GtkWidget * gnc_gen_trans_list_append_text_widget | ( | GNCImportMainMatcher * | info | ) |
Returns the append_text widget of this dialog.
info | A pointer to the GNCImportMainMatcher structure. |
Definition at line 2123 of file import-main-matcher.c.
void gnc_gen_trans_list_delete | ( | GNCImportMainMatcher * | info | ) |
Deletes the given object.
Definition at line 181 of file import-main-matcher.c.
gboolean gnc_gen_trans_list_empty | ( | GNCImportMainMatcher * | info | ) |
Checks whether there are no transactions to match.
info | A pointer to the GNCImportMainMatcher structure. |
Definition at line 230 of file import-main-matcher.c.
GtkWidget * gnc_gen_trans_list_get_reconcile_after_close_button | ( | GNCImportMainMatcher * | info | ) |
Returns the reconcile after close check button.
info | A pointer to the GNCImportMainMatcher structure. |
Definition at line 1929 of file import-main-matcher.c.
GNCImportMainMatcher * gnc_gen_trans_list_new | ( | GtkWidget * | parent, |
const gchar * | heading, | ||
gboolean | all_from_same_account, | ||
gint | match_date_hardlimit, | ||
gboolean | show_all | ||
) |
Create a new generic transaction dialog window and return it.
parent | The parent GtkWidget. May be NULL. |
heading | The heading label in the Importer window. May be NULL. |
all_from_same_account | Set this to TRUE if ALL the transaction 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. |
match_date_hardlimit | The number of days that a matching split may differ from the given transaction before it is discarded immediately. In other words, any split that is more distant from the given transaction than this match_date_hardlimit days will be ignored altogether. For use cases without paper checks (e.g. HBCI), values like 14 (days) might be appropriate, whereas for use cases with paper checks (e.g. OFX, QIF), values like 42 (days) seem more appropriate. |
show_all | if true, all widgets are shown |
Definition at line 1429 of file import-main-matcher.c.
gboolean gnc_gen_trans_list_run | ( | GNCImportMainMatcher * | info | ) |
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.
info | A pointer to the GNCImportMainMatcher structure. |
Definition at line 1530 of file import-main-matcher.c.
void gnc_gen_trans_list_show_all | ( | GNCImportMainMatcher * | info | ) |
Shows widgets.
info | A pointer to the GNCImportMainMatcher structure. |
Definition at line 448 of file import-main-matcher.c.
void gnc_gen_trans_list_show_reconcile_after_close_button | ( | GNCImportMainMatcher * | info, |
gboolean | reconcile_after_close, | ||
gboolean | active | ||
) |
Show and set the reconcile after close check button.
info | A pointer to the GNCImportMainMatcher structure. |
reconcile_after_close | A gboolean that shows or hides the button. |
active | A gboolean to set or clear the check button. |
Definition at line 1920 of file import-main-matcher.c.
GtkWidget * gnc_gen_trans_list_widget | ( | GNCImportMainMatcher * | info | ) |
Returns the widget of this dialog.
info | A pointer to the GNCImportMainMatcher structure. |
Definition at line 2116 of file import-main-matcher.c.
gboolean gnc_import_exists_online_id | ( | Transaction * | trans, |
GHashTable * | acct_id_hash | ||
) |
Checks whether the given transaction's online_id already exists in its parent account.
The given transaction has to be open for editing. If a matching online_id exists, the transaction is destroyed (!) and TRUE is returned, otherwise FALSE is returned.
trans | The transaction for which to check for an existing online_id. |
Definition at line 1189 of file import-backend.c.
void gnc_import_match_picker_run_and_close | ( | GtkWidget * | parent, |
GNCImportTransInfo * | transaction_info, | ||
GNCImportPendingMatches * | pending_matches | ||
) |
Run a match_picker dialog so that the selected-MatchInfo in the given trans_info is updated accordingly.
Run a match_picker dialog where the user should pick the best match for 'one' given transaction, so that the selected-MatchInfo in the given trans_info is updated accordingly.
This functions will only return after the user clicked Ok, Cancel, or Window-Close.
This functions will only return after the user clicked Ok, Cancel, or Window-Close.
The dialog uses the same functionality as the one created through gnc_import_add_trans(), except that its two listviews are shown above one another, and the listview of downloaded transactions shows only one transaction, namely, the given trans_info.
This function is used from the gnc-gen-transaction code.
parent | The parent widget |
transaction_info | The TransInfo for which the user is supposed to pick a matching transaction. |
pending_matches | List of transactions |
Definition at line 508 of file import-match-picker.c.
gint gnc_import_MatchInfo_get_probability | ( | const GNCImportMatchInfo * | info | ) |
Get the probability (confidence level) of this MatchInfo.
info | Can be NULL, in which case the function returns 0 |
Definition at line 263 of file import-backend.c.
Split * gnc_import_MatchInfo_get_split | ( | const GNCImportMatchInfo * | info | ) |
Get the split ('this-side split') of this MatchInfo.
Definition at line 256 of file import-backend.c.
gboolean gnc_import_process_trans_item | ( | GncImportMatchMap * | matchmap, |
GNCImportTransInfo * | trans_info | ||
) |
/brief – Processes one match according to its selected action.
This function is intended to be called when the importer dialog is finished.
It should be called once for each imported transaction and processes each ImportTransInfo according to its selected action: For GNCImport_ADD, the transaction is added etc. etc.
Each successful match is also stored in the given ImportMatchMap, or, if that argument is NULL, in the ImportMatchMap of each originating account.
matchmap | The ImportMatchMap where each match should be stored. May be NULL, in which case the ImportMatchMap of each account will be used. |
trans_info | The ImportTransInfo item to process. |
Definition at line 932 of file import-backend.c.
Account * gnc_import_select_account | ( | GtkWidget * | parent, |
const gchar * | account_online_id_value, | ||
gboolean | auto_create, | ||
const gchar * | account_human_description, | ||
const gnc_commodity * | new_account_default_commodity, | ||
GNCAccountType | new_account_default_type, | ||
Account * | default_selection, | ||
gboolean * | ok_pressed | ||
) |
Must be called with a string containing a unique identifier for the account.
If an account with a matching online_id is found, the function immediately returns with a pointer to that account. Otherwise, the user is prompted to select a GnuCash account or create a new one (in both cases, the unique identifier is written to the account, so the user won't be prompted again). If the user refuses to select or create an account, NULL is returned.
parent | The parent widget. Can be NULL. |
account_online_id_value | The string containing your unique account_id coming from some string of your module. This is the normal mode of operation. Can be NULL. |
If account_online_id_value==NULL, you basically end up with an account selector that allows you to select an account whose GncGUID will be remembered elsewhere. You would fill account_human_description to tell the user what he is looking for. In this mode, the online_id field of the found account will not be touched. To use this mode, auto_create must NOT be set to 0.
account_human_description | A human-readable description of the account. Can be NULL. If it is not NULL, it will be shown before the id in the account matching dialog. It will also be used as the default account name if a new account is created. |
new_account_default_commodity | Default commodity of the new account. Can be NULL. If not NULL, it will be the account's commodity if a new account is created. Also, if not NULL, the function will also warn the user if the found or created account's commodity doesn't match. |
new_account_default_type | Default account type of a new account. Can be NULL. If not ACCT_TYPE_NONE, it will be the account's type if a new account is created. If not ACCT_TYPE_NONE, the function will also warn the user if the found or created account's commodity doesn't match. |
auto_create | Only active if no account with the account_online_id_value could be found in gnucash, or if online-id was NULL. In that case, if auto_create is TRUE (nonzero), the user will be asked to create a new account. If auto_create is FALSE (zero), this function will simply return NULL but will neither select nor create any account. |
default_selection | If not NULL, that account will be pre-selected by default. |
ok_pressed | A pointer to gboolean. If non-NULL, whether or not the picker dialog was closed by the user pressing ok will be stored in the parameter. If no dialog was created by the gnc_import_select_account() call, TRUE is always returned. |
Definition at line 394 of file import-account-matcher.c.
gnc_commodity * gnc_import_select_commodity | ( | const char * | cusip, |
gboolean | ask_on_unknown, | ||
const char * | default_fullname, | ||
const char * | default_mnemonic | ||
) |
Must be called with a string containing a unique identifier for the commodity.
If an commodity with a matching cusip is found, the function immediately returns with a pointer to that commodity. Otherwise, the user may be prompted to select a GnuCash commodity or create a new one (in both cases, the cusip is written to the commodity's cusip field, overwriting anything that was there before.
cusip | The string containing the code for which you want a matching commodity. A CUISP code or similar UNIQUE code. The stock ticker is NOT appropriate, unless you have no other option. Must be non-NULL. |
ask_on_unknown | If the cusip value is unknown and this parameter is false (zero), the function returns NULL. Otherwise the user will be asked to select an existing or create a new commodity. |
default_fullname | A human-readable description of the commodity, such as the stock name. Can be NULL. If it is not NULL, it will be shown to the user when selecting a commodity. It will also be used as the default if a new commodity is created. |
default_mnemonic | Usually the stock ticker or similar. Can be NULL. If it is not NULL, it will be shown to the user when selecting a commodity. It will also be used as the default if a new commodity is created. |
Definition at line 53 of file import-commodity-matcher.c.
double gnc_import_Settings_get_fuzzy_amount | ( | GNCImportSettings * | settings | ) |
Return the allowed amount range for fuzzy amount matching.
Definition at line 122 of file import-settings.c.
gint gnc_import_Settings_get_match_date_hardlimit | ( | const GNCImportSettings * | settings | ) |
Returns the hard-limiting number of days that a matching split may differ.
Definition at line 188 of file import-settings.c.
void gnc_import_Settings_set_match_date_hardlimit | ( | GNCImportSettings * | settings, |
gint | match_date_hardlimit | ||
) |
match_date_hardlimit | The number of days that a matching split may differ from the given transaction before it is discarded immediately. In other words, any split that is more distant from the given transaction than this match_date_hardlimit days will be ignored altogether. For use cases without paper checks (e.g. HBCI), values like 14 (days) might be appropriate, whereas for use cases with paper checks (e.g. OFX, QIF), values like 42 (days) seem more appropriate. |
Definition at line 182 of file import-settings.c.
GNCImportAction gnc_import_TransInfo_get_action | ( | const GNCImportTransInfo * | info | ) |
Returns the currently selected action for this TransInfo.
Definition at line 184 of file import-backend.c.
Account * gnc_import_TransInfo_get_destacc | ( | const GNCImportTransInfo * | info | ) |
Returns the 'other account' of this transaction.
May return NULL.
Definition at line 203 of file import-backend.c.
gboolean gnc_import_TransInfo_get_destacc_selected_manually | ( | const GNCImportTransInfo * | info | ) |
Returns if the currently selected destination account for auto-matching was selected by the user.
Definition at line 224 of file import-backend.c.
Split * gnc_import_TransInfo_get_fsplit | ( | const GNCImportTransInfo * | info | ) |
Returns the first split of the transaction of this TransInfo.
Definition at line 153 of file import-backend.c.
GList * gnc_import_TransInfo_get_match_list | ( | const GNCImportTransInfo * | info | ) |
Returns the stored list of possible matches.
Definition at line 106 of file import-backend.c.
gboolean gnc_import_TransInfo_get_match_selected_manually | ( | const GNCImportTransInfo * | info | ) |
Returns if the currently selected match was selected by the user.
Definition at line 177 of file import-backend.c.
guint32 gnc_import_TransInfo_get_ref_id | ( | const GNCImportTransInfo * | info | ) |
Returns the reference id for this TransInfo.
Definition at line 231 of file import-backend.c.
GNCImportMatchInfo * gnc_import_TransInfo_get_selected_match | ( | const GNCImportTransInfo * | info | ) |
Returns the currently selected match in this TransInfo.
Definition at line 160 of file import-backend.c.
Transaction * gnc_import_TransInfo_get_trans | ( | const GNCImportTransInfo * | info | ) |
Returns the transaction of this TransInfo.
Definition at line 129 of file import-backend.c.
void gnc_import_TransInfo_init_matches | ( | GNCImportTransInfo * | trans_info, |
GNCImportSettings * | settings | ||
) |
Iterates through all splits of the originating account of trans_info.
Sorts the resulting list and sets the selected_match and action fields in the trans_info.
Sorts the resulting list and sets the selected_match and action fields in the trans_info.
trans_info | The TransInfo for which the matches should be found, sorted, and selected. |
settings | The structure that holds all the user preferences. |
Definition at line 1272 of file import-backend.c.
gboolean gnc_import_TransInfo_is_balanced | ( | const GNCImportTransInfo * | info | ) |
Returns if the transaction stored in the TransInfo is currently balanced.
Definition at line 136 of file import-backend.c.
GNCImportTransInfo * gnc_import_TransInfo_new | ( | Transaction * | trans, |
GncImportMatchMap * | matchmap | ||
) |
Create a new object of GNCImportTransInfo here.
Allocates a new TransInfo object, with the Transaction 'trans' already stored in there.
Also, this already checks the ImportMatchMap for automated destination account matching. The given MatchMap may be NULL, in which case the ImportMatchMap of the originating account will be used.
trans | The transaction that this TransInfo should work with. |
matchmap | MatchMap used for automated destination account choosing. This may be NULL, in which case the MatchMap of the originating account will be used. |
Definition at line 1236 of file import-backend.c.
void gnc_import_TransInfo_set_action | ( | GNCImportTransInfo * | info, |
GNCImportAction | action | ||
) |
Set the action for this TransInfo.
Also sets the previous action.
Definition at line 191 of file import-backend.c.
void gnc_import_TransInfo_set_append_text | ( | GNCImportTransInfo * | info, |
gboolean | append_text | ||
) |
Set the append_text for this TransInfo.
Definition at line 247 of file import-backend.c.
void gnc_import_TransInfo_set_destacc | ( | GNCImportTransInfo * | info, |
Account * | acc, | ||
gboolean | selected_manually | ||
) |
Set the 'other account' of this transaction (used for auto-balance if needed).
May be set to NULL.
selected_manually | TRUE or FALSE; Was this account set as a result of a selection by the user or by an algorithm? |
Definition at line 208 of file import-backend.c.
void gnc_import_TransInfo_set_match_list | ( | GNCImportTransInfo * | info, |
GList * | match_list | ||
) |
Assigns the list of possible matches.
Definition at line 113 of file import-backend.c.
void gnc_import_TransInfo_set_ref_id | ( | GNCImportTransInfo * | info, |
guint32 | ref_id | ||
) |
Set the reference id for this TransInfo.
Definition at line 238 of file import-backend.c.
void gnc_import_TransInfo_set_selected_match_info | ( | GNCImportTransInfo * | info, |
GNCImportMatchInfo * | match, | ||
gboolean | selected_manually | ||
) |
Sets the currently selected match in this TransInfo.
selected_manually | TRUE or FALSE; Was this match set as a result of a selection by the user or by an algorithm? |
Definition at line 167 of file import-backend.c.
void on_matcher_help_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
This allows for the transaction help dialog to be started from the assistant button callback.
button. | The button widget clicked on in the call back. |
user_data. | A pointer to a structure. |
Definition at line 568 of file import-main-matcher.c.
void split_find_match | ( | GNCImportTransInfo * | trans_info, |
Split * | split, | ||
gint | display_threshold, | ||
gint | date_threshold, | ||
gint | date_not_threshold, | ||
double | fuzzy_amount_difference | ||
) |
The transaction matching heuristics are here.
Evaluates the match between trans_info and split using the provided parameters.
trans_info | The TransInfo for the imported transaction |
split | The register split that should be evaluated for a match. |
display_threshold | Minimum match score to include split in the list of matches. |
date_threshold | Maximum number of days a match considered likely. |
date_not_threshold | Minimum number of days a match is considered unlikely. |
fuzzy_amount_difference | Maximum amount difference to consider the match good. |
Definition at line 627 of file import-backend.c.