From aa30d872e7786a79f682c200089f1e5f549e7a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoit=20Gr=C3=A9goire?= Date: Sat, 7 Dec 2002 08:13:46 +0000 Subject: [PATCH] =?UTF-8?q?2002-13-6=20=20Benoit=20Gr=EF=BF=BDgoire=20=20=20=09*=20src/import-export/ofx/gnc-ofx-im?= =?UTF-8?q?port.c:=20=20Do=20the=20"right"=20=09thing=20for=20setting=20sp?= =?UTF-8?q?lit=20amount=20and=20value.=20=09*=20src/import-export/import-m?= =?UTF-8?q?ain-matcher.c:=20Cosmetic=20=09improvements=20for=20balance=20d?= =?UTF-8?q?isplay=20and=20window=20resizing.=20=09*=20All=20other=20affect?= =?UTF-8?q?ed=20files:=20=20Doxygenify=20everything.=20=20Take=20a=20=09lo?= =?UTF-8?q?ok,=20run=20make=20doc,=20and=20open=20src/doc/html/index.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7637 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 6 ++ src/import-export/generic-import.glade | 16 ++-- src/import-export/gnc-gen-transaction.c | 3 +- src/import-export/gncmod-generic-import.c | 3 +- src/import-export/import-account-matcher.c | 8 +- src/import-export/import-account-matcher.h | 33 ++++---- src/import-export/import-backend.c | 12 ++- src/import-export/import-backend.h | 29 ++++--- src/import-export/import-commodity-matcher.c | 9 +- src/import-export/import-commodity-matcher.h | 23 +++-- src/import-export/import-main-matcher.c | 88 +++++++++++--------- src/import-export/import-main-matcher.h | 18 ++-- src/import-export/import-match-map.c | 9 +- src/import-export/import-match-map.h | 41 +++++---- src/import-export/import-match-picker.c | 8 +- src/import-export/import-match-picker.h | 17 ++-- src/import-export/import-settings.c | 9 +- src/import-export/import-settings.h | 16 ++-- src/import-export/import-utilities.c | 8 +- src/import-export/import-utilities.h | 23 ++++- src/import-export/ofx/gnc-ofx-import.c | 41 ++++++--- src/import-export/ofx/gncmod-ofx-import.c | 28 ++++++- 22 files changed, 282 insertions(+), 166 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92c9bac096..672624819d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-12-6 Benoit Grégoire + * src/import-export/import-backend.c: Fix for gcc2 + +2002-12-6 Benoit Grégoire + * src/import-export/import-backend.c: Fix for gcc2 + 2002-12-06 Derek Atkins * revert patch in src/engine/Transaction.c -- imbalance is computed diff --git a/src/import-export/generic-import.glade b/src/import-export/generic-import.glade index ae18494809..d1a1e28c18 100644 --- a/src/import-export/generic-import.glade +++ b/src/import-export/generic-import.glade @@ -28,9 +28,9 @@ False 800 600 - True + False True - True + False False False @@ -244,9 +244,9 @@ False 800 600 - True + False True - True + False False False @@ -531,9 +531,9 @@ False 800 600 - True + False True - True + False True True @@ -781,9 +781,9 @@ click "Ok". False 800 600 - True + False True - True + False False False diff --git a/src/import-export/gnc-gen-transaction.c b/src/import-export/gnc-gen-transaction.c index f23bf7dc2b..22fff3cf5d 100644 --- a/src/import-export/gnc-gen-transaction.c +++ b/src/import-export/gnc-gen-transaction.c @@ -16,7 +16,8 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file +/** @internal + @file @brief Christian Stimming's matcher @author Copyright (C) 2002 Christian Stimming */ diff --git a/src/import-export/gncmod-generic-import.c b/src/import-export/gncmod-generic-import.c index 1d1691af2a..226c162a87 100644 --- a/src/import-export/gncmod-generic-import.c +++ b/src/import-export/gncmod-generic-import.c @@ -1,4 +1,5 @@ - /**@file + /**@internal + @file \brief module definition/initialization for the generic import infrastructure \author Copyright (c) 2002 Benoit Grégoire bock@step.polymtl.ca */ diff --git a/src/import-export/import-account-matcher.c b/src/import-export/import-account-matcher.c index d01d4286b7..df2610f065 100644 --- a/src/import-export/import-account-matcher.c +++ b/src/import-export/import-account-matcher.c @@ -16,8 +16,11 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/**@file - * \brief Account-matcher.h: A very generic and flexible account matcher/picker +/** @addtogroup Import_Export + @{ */ +/**@internal + @file import-account-matcher.c + * \brief A very generic and flexible account matcher/picker \author Copyright (C) 2002 Benoit Grégoire */ #define _GNU_SOURCE @@ -302,3 +305,4 @@ Account * gnc_import_select_account(char * account_online_id_value, DEBUG("Return value: %p%s%s%s",retval,", account name:",xaccAccountGetName(retval),"\n"); return retval; } +/**@}*/ diff --git a/src/import-export/import-account-matcher.h b/src/import-export/import-account-matcher.h index b5ca16f4c0..23ddd5609b 100644 --- a/src/import-export/import-account-matcher.h +++ b/src/import-export/import-account-matcher.h @@ -16,18 +16,18 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/**@file - * \brief Account-matcher.h: A very generic and flexible account matcher/picker - \author Copyright (C) 2002 Benoit Grégoire +/** @addtogroup Import_Export + @{ */ +/**@file import-account-matcher.h + @brief Generic and very flexible account matcher/picker + @author Copyright (C) 2002 Benoit Grégoire */ #ifndef ACCOUNT_MATCHER_H #define ACCOUNT_MATCHER_H #include "Account.h" -/* The gnc_import_select_account(): - - Must be called with a string containing a unique identifier for the +/** Must be called with a string containing a unique identifier for the account. If an account with a matching online_id kvp_frame is found, the function immediately returns with a pointer to that account. Otherwise, the user is prompted to select a GnuCash @@ -36,9 +36,7 @@ again). If the user refuses to select or create an account, NULL is returned. - Params: - - account_online_id_value: The string containing your unique account_id + @param 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. @@ -49,33 +47,35 @@ kvp_frame of the found account will not be touched. To use this mode, auto_create must NOT be set to 0. - gchar * account_human_description: A human-readable description of + @param 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. - gnc_commodity * new_account_default_currenc: Default commodity of + @param 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. - GNCAccountType new_account_default_type: Default account type of a + @param new_account_default_type + Default account type of a new account. Can be NULL. If not NO_TYPE, it will be the account's type if a new account is created. If not NO_TYPE, the function will also warn the user if the found or created account's commodity doesn't match. - char auto_create: If 0, if the account_online_id_value in unknown, + @param auto_create If 0, if the account_online_id_value in unknown, the function returns NULL, otherwise, the user will be asked to create a new account. - Account * default_selection: If not NULL, that account will be + @param default_selection If not NULL, that account will be pre-selected by default. - Return: A pointer to the found or created Account, or NULL if no + @return A pointer to the found or created Account, or NULL if no account was found or created. - */ Account * gnc_import_select_account(char * account_online_id_value, char auto_create, @@ -85,3 +85,4 @@ Account * gnc_import_select_account(char * account_online_id_value, Account * default_selection); #endif +/**@}*/ diff --git a/src/import-export/import-backend.c b/src/import-export/import-backend.c index 38b73f1754..ca3cbd58ac 100644 --- a/src/import-export/import-backend.c +++ b/src/import-export/import-backend.c @@ -16,9 +16,13 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file +/** @addtogroup Import_Export + @{ */ +/** @internal + @file import-backend.c @brief import-backend.c: Generic importer backend implementation (duplicate matching algorithm, action handling, etc.) - @author Copyright (C) 2002 Benoit Grégoire, Christian Stimming + @author Copyright (C) 2002 Benoit Grégoire + @author Christian Stimming */ #define _GNU_SOURCE @@ -203,7 +207,6 @@ gnc_import_MatchInfo_get_probability (const GNCImportMatchInfo * info) { if(info) { - g_assert (info); return info->probability; } else @@ -398,7 +401,7 @@ matchmap_store_destination (GncImportMatchMap *matchmap, -/** /brief The transaction matching heuristics are here. +/** @brief The transaction matching heuristics are here. */ static void split_find_match (GNCImportTransInfo * trans_info, Split * split, @@ -863,3 +866,4 @@ gnc_import_TransInfo_init_matches (GNCImportTransInfo *trans_info, trans_info->previous_action=trans_info->action; } +/** @} */ diff --git a/src/import-export/import-backend.h b/src/import-export/import-backend.h index 315456adb0..ca35293683 100644 --- a/src/import-export/import-backend.h +++ b/src/import-export/import-backend.h @@ -1,10 +1,4 @@ /********************************************************************\ - * Transaction-matcher.h -- * - * See file generic-import-design.txt for * - * description * - * (GnuCash) * - * Copyright (C) 2002 Benoit Grégoire * - * * * 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 * @@ -22,9 +16,12 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file - @brief import-backend.h: Generic importer backend interface - @author Copyright (C) 2002 Benoit Grégoire, Christian Stimming +/** @addtogroup Import_Export + @{ */ +/** @file import-backend.h + @brief Generic importer backend interface + @author Copyright (C) 2002 Benoit Grégoire + @author Christian Stimming */ #ifndef TRANSACTION_MATCHER_H @@ -46,7 +43,6 @@ typedef enum _action { GNCImport_LAST_ACTION, GNCImport_INVALID_ACTION } GNCImportAction; -/* Note: If you modify this, modify also get_next_action(). */ /************************************************************************ * @name Non-GUI Functions @@ -224,20 +220,23 @@ gnc_import_TransInfo_set_destacc (GNCImportTransInfo *info, gboolean gnc_import_TransInfo_get_destacc_selected_manually (const GNCImportTransInfo *info); -/*@}*/ +/**@}*/ /** @name Getters/Setters for GNCImportMatchInfo */ -/*@{*/ +/**@{*/ -/* Get the split ('this-side split') of this MatchInfo. */ +/** Get the split ('this-side split') of this MatchInfo. */ Split * gnc_import_MatchInfo_get_split (const GNCImportMatchInfo * info); -/* Get the probability (confidence level) of this MatchInfo. +/** Get the probability (confidence level) of this MatchInfo. @param info Can be NULL, in which case the function returns 0*/ gint gnc_import_MatchInfo_get_probability (const GNCImportMatchInfo * info); -/*@}*/ +/**@}*/ #endif +/** @} */ + + diff --git a/src/import-export/import-commodity-matcher.c b/src/import-export/import-commodity-matcher.c index a3800f1fd6..7d2b83f27d 100755 --- a/src/import-export/import-commodity-matcher.c +++ b/src/import-export/import-commodity-matcher.c @@ -16,8 +16,11 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file - @brief import-commodity-matcher.h: A Generic commodity matcher/picker +/** @addtogroup Import_Export + @{ */ +/**@internal + @file import-commodity-matcher.c + @brief A Generic commodity matcher/picker @author Copyright (C) 2002 Benoit Grégoire */ #define _GNU_SOURCE @@ -126,4 +129,4 @@ gnc_commodity * gnc_import_select_commodity(char * exchange_code, } return retval; }; - +/**@}*/ diff --git a/src/import-export/import-commodity-matcher.h b/src/import-export/import-commodity-matcher.h index ed29e45e7d..97996a280d 100644 --- a/src/import-export/import-commodity-matcher.h +++ b/src/import-export/import-commodity-matcher.h @@ -16,8 +16,10 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file - @brief import-commodity-matcher.h: A Generic commodity matcher/picker +/** @addtogroup Import_Export + @{ */ +/** @file import-commodity-matcher.h + @brief A Generic commodity matcher/picker @author Copyright (C) 2002 Benoit Grégoire */ #ifndef IMPORT_COMMODITY_MATCHER_H @@ -25,8 +27,7 @@ #include "gnc-commodity.h" -/* The gnc_import_select_commodity(): - +/** Must be called with a string containing a unique identifier for the commodity. If an commodity with a matching exchange_code is found, the function immediately returns with a pointer to that @@ -35,28 +36,25 @@ written to the commodity's exchange_code field, overwriting anything that was there before. - Params: - - char * exchange_code: The string containing the code for which you + @param exchange_code 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. - char auto_create: If 0, if the exchange_code value in unknown, + @param auto_create If 0, if the exchange_code value in unknown, the function returns NULL, otherwise, the user will be asked to create a new account. - char * default_fullname: A human-readable description of the commodity, such + @param 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. - char * default_mnemonic: Usually the stock ticker or similar. Can be NULL. + @param 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. - - Return: A pointer to the found or created commodity, or NULL if no + @return A pointer to the found or created commodity, or NULL if no account was found or created. */ @@ -66,3 +64,4 @@ gnc_commodity * gnc_import_select_commodity(char * exchange_code, char * default_mnemonic); #endif +/**@}*/ diff --git a/src/import-export/import-main-matcher.c b/src/import-export/import-main-matcher.c index e58781d349..da3697d040 100644 --- a/src/import-export/import-main-matcher.c +++ b/src/import-export/import-main-matcher.c @@ -16,9 +16,13 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/**@file - @brief import-main-mathcer.c: Transaction matcher main window - @author Copyright (C) 2002 Benoit Grégoire, Christian Stimming +/** @addtogroup Import_Export + @{ */ +/** @internal + @file import-main-matcher.c + @brief Transaction matcher main window + @author Copyright (C) 2002 Benoit Grégoire + @author Christian Stimming */ #include "config.h" @@ -61,7 +65,6 @@ struct _generic_transaction_info #define DOWNLOADED_CLIST_ACTION_INFO 9 static short module = MOD_IMPORT; -/* XPM */ static char * fleche_xpm[] = { "17 22 41 1", " c None", @@ -128,7 +131,6 @@ static char * fleche_xpm[] = { "+0%%%%%%%%%%%%%a+", "b+++++++++++++++b"}; -/* XPM */ static char * checkbox_checked_xpm[] = { "16 16 28 1", " c None", @@ -176,8 +178,6 @@ static char * checkbox_checked_xpm[] = { "................", " .............. "}; - -/* XPM */ static char * checkbox_unchecked_xpm[] = { "12 12 14 1", " c None", @@ -493,25 +493,25 @@ trans_clist_row_destroy_cb (gpointer data) } -static void free_clist_row_text (GNCGenTransaction *gui, - int row_number) -{ +/*static void free_clist_row_text (GNCGenTransaction *gui, + int row_number) + { gchar *tmp; gint i; - + DEBUG("Begin"); g_assert (gui); for (i = 0; i < NUM_COLUMNS_DOWNLOADED_CLIST; i++) - { - tmp=NULL; - if(gtk_clist_get_text (GTK_CLIST (gui->clist), row_number, - i, - &tmp)==1) - { - g_free(tmp); - } - } -} + { + tmp=NULL; + if(gtk_clist_get_text (GTK_CLIST (gui->clist), row_number, + i, + &tmp)==1) + { + g_free(tmp); + } + } + }*/ static char ** gen_clist_row_text (GNCImportTransInfo *info) { @@ -553,9 +553,17 @@ static char ** gen_clist_row_text (GNCImportTransInfo *info) text[DOWNLOADED_CLIST_MEMO] = g_strdup(xaccSplitGetMemo(gnc_import_TransInfo_get_fsplit(info) ) ); /*Imbalance*/ - text[DOWNLOADED_CLIST_IMBALANCE]=g_strdup(xaccPrintAmount (xaccTransGetImbalance(gnc_import_TransInfo_get_trans(info) ), - gnc_default_print_info (TRUE) ) - ); + if(gnc_import_TransInfo_is_balanced(info)==TRUE) + { + text[DOWNLOADED_CLIST_IMBALANCE]=g_strdup(""); + } + else + { + text[DOWNLOADED_CLIST_IMBALANCE]=g_strdup(xaccPrintAmount (xaccTransGetImbalance(gnc_import_TransInfo_get_trans(info) ), + gnc_commodity_print_info (xaccTransGetCurrency(gnc_import_TransInfo_get_trans (info)),TRUE) ) + ); + } + /*Actions*/ text[DOWNLOADED_CLIST_ACTION_ADD] = g_strdup(""); text[DOWNLOADED_CLIST_ACTION_CLEAR] = g_strdup(""); @@ -571,21 +579,22 @@ static char ** gen_clist_row_text (GNCImportTransInfo *info) } else { - if (gnc_import_TransInfo_get_destacc (info) != NULL) { - tmp = xaccAccountGetFullName - (gnc_import_TransInfo_get_destacc (info), - gnc_get_account_separator ()); - if(gnc_import_TransInfo_get_destacc_selected_manually(info)==TRUE) - { - select_origin=MANUALY_SELECTED_TEXT; - } - else - { - select_origin=AUTO_SELECTED_TEXT; - } - text[DOWNLOADED_CLIST_ACTION_INFO] = g_strdup_printf(_("Add with balancing split into (%s) account \"%s\""),select_origin,tmp); - free (tmp); - } + if (gnc_import_TransInfo_get_destacc (info) != NULL) + { + tmp = xaccAccountGetFullName + (gnc_import_TransInfo_get_destacc (info), + gnc_get_account_separator ()); + if(gnc_import_TransInfo_get_destacc_selected_manually(info)==TRUE) + { + select_origin=MANUALY_SELECTED_TEXT; + } + else + { + select_origin=AUTO_SELECTED_TEXT; + } + text[DOWNLOADED_CLIST_ACTION_INFO] = g_strdup_printf(_("Add with balancing split into (%s) account \"%s\""),select_origin,tmp); + free (tmp); + } else { text[DOWNLOADED_CLIST_ACTION_INFO] = g_strdup(_("Add UNBALANCED!")); @@ -784,3 +793,4 @@ void gnc_gen_trans_list_add_trans(GNCGenTransaction *gui, Transaction *trans) return; }/* end gnc_import_add_trans() */ +/** @} */ diff --git a/src/import-export/import-main-matcher.h b/src/import-export/import-main-matcher.h index 1b4b41e6a1..0dd4871423 100644 --- a/src/import-export/import-main-matcher.h +++ b/src/import-export/import-main-matcher.h @@ -16,9 +16,12 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/**@file - @brief import-main-mathcer.h: Transaction matcher main window - @author Copyright (C) 2002 Benoit Grégoire, Christian Stimming +/** @addtogroup Import_Export + @{ */ +/**@file import-main-matcher.h + @brief Transaction matcher main window + @author Copyright (C) 2002 Benoit Grégoire + @author Christian Stimming */ #ifndef GNC_GEN_TRANSACTION_H @@ -53,19 +56,20 @@ void gnc_gen_trans_list_delete (GNCGenTransaction *info); void gnc_gen_trans_list_add_trans(GNCGenTransaction *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. + 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. */ + transactions. */ void gnc_gen_trans_list_freeze (GNCGenTransaction *gui); /** Thaw the underlying GtkCList. Do this after you added a lot of - * transactions. */ + transactions. */ void gnc_gen_trans_list_thaw (GNCGenTransaction *gui); #endif +/**@}*/ diff --git a/src/import-export/import-match-map.c b/src/import-export/import-match-map.c index faa3a22f17..9214ba01ad 100644 --- a/src/import-export/import-match-map.c +++ b/src/import-export/import-match-map.c @@ -16,10 +16,13 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file +/** @addtogroup Import_Export + @{ */ +/** @internal + @file import-match-map.c @brief Generic import mapper service, maps strings->accounts * - import-match-map.c: An import mapper service that stores Account Maps for the + An import mapper service that stores Account Maps for the generic importer. This allows importers to map various "strings" to Gnucash accounts in a generic manner. @author Copyright (C) 2002 Derek Atkins @@ -138,3 +141,5 @@ void gnc_imap_add_account (GncImportMatchMap *imap, const char *category, /* XXX Mark the account (or book) as dirty! */ } + +/** @} */ diff --git a/src/import-export/import-match-map.h b/src/import-export/import-match-map.h index 404b965e8f..1a106d105f 100644 --- a/src/import-export/import-match-map.h +++ b/src/import-export/import-match-map.h @@ -16,10 +16,12 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file +/** @addtogroup Import_Export + @{ */ +/** @file import-match-map.h @brief Generic import mapper service, maps strings->accounts * - import-match-map.h: An import mapper service that stores Account Maps for the + An import mapper service that stores Account Maps for the generic importer. This allows importers to map various "strings" to Gnucash accounts in a generic manner. @author Copyright (C) 2002 Derek Atkins @@ -32,37 +34,42 @@ typedef struct _GncImportMatchMap GncImportMatchMap; #include "Account.h" #include "gnc-book.h" -/* Obtain an ImportMatchMap object from an Account or a Book */ +/** @{ +Obtain an ImportMatchMap object from an Account or a Book */ GncImportMatchMap * gnc_imap_create_from_account (Account *acc); GncImportMatchMap * gnc_imap_create_from_book (GNCBook *book); +/*@}*/ -/* Destroy an import map. But all stored entries will still continue - * to exist in the underlying kvp frame of the account or book. */ +/** Destroy an import map. But all stored entries will still continue + to exist in the underlying kvp frame of the account or book. */ void gnc_imap_destroy (GncImportMatchMap *imap); -/* Clear an import map -- this removes ALL entries in the map */ +/** Clear an import map -- this removes ALL entries in the map */ void gnc_imap_clear (GncImportMatchMap *imap); -/* Look up an Account in the map */ +/** Look up an Account in the map */ Account * gnc_imap_find_account (GncImportMatchMap *imap, const char *category, const char *key); -/* Store an Account in the map. This mapping is immediatly stored in - * the underlying kvp frame, regardless of whether the MatchMap is - * destroyed later or not. */ +/** Store an Account in the map. This mapping is immediatly stored in + the underlying kvp frame, regardless of whether the MatchMap is + destroyed later or not. */ void gnc_imap_add_account (GncImportMatchMap *imap, const char *category, const char *key, Account *acc); -/* some well-known categories - * - * NOTE: You DO NOT have to use these values in your importer -- these - * are just "well known" values, not "mandatory" values. You are free - * to use these if they apply, map your own fields to these labels, or - * create your own category strings. - */ +/** @name Some well-known categories + + NOTE: You DO NOT have to use these values in your importer -- these + are just "well known" values, not "mandatory" values. You are free + to use these if they apply, map your own fields to these labels, or + create your own category strings. +*/ +/** @{*/ #define GNCIMPORT_DESC "desc" #define GNCIMPORT_MEMO "memo" #define GNCIMPORT_PAYEE "payee" +/**@}*/ #endif /* GNC_IMPORT_MATCH_MAP_H */ +/**@}*/ diff --git a/src/import-export/import-match-picker.c b/src/import-export/import-match-picker.c index 3952006a4b..3804721dbe 100644 --- a/src/import-export/import-match-picker.c +++ b/src/import-export/import-match-picker.c @@ -16,8 +16,11 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file - @brief import-match-picker.c: The transaction match picker dialog +/** @addtogroup Import_Export + @{ */ +/** @internal +@file import-match-picker.c + @brief The transaction match picker dialog implementation @author Copyright (C) 2002 Benoit Grégoire */ @@ -368,3 +371,4 @@ gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info) } } +/** @} */ diff --git a/src/import-export/import-match-picker.h b/src/import-export/import-match-picker.h index a43fc1df81..f54260268b 100644 --- a/src/import-export/import-match-picker.h +++ b/src/import-export/import-match-picker.h @@ -16,8 +16,10 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file - @brief import-match-picker.h -- THe transaction match picker dialog interface +/** @addtogroup Import_Export + @{ */ +/** @file import-match-picker.h + @brief The transaction match picker dialog interface @author Copyright (C) 2002 Benoit Grégoire */ @@ -32,14 +34,9 @@ typedef struct _transpickerdialog GNCImportMatchPicker; * GUI Functions ************************************************************************/ -/** @name Match_Picker Dialog - * - * A dialog where the user should pick the best match for *one* given - * transaction. - */ -/*@{*/ /** - * Run a match_picker dialog so that the selected-MatchInfo in the + * 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. * @@ -54,7 +51,7 @@ typedef struct _transpickerdialog GNCImportMatchPicker; * pick a matching transaction. */ void gnc_import_match_picker_run_and_close (GNCImportTransInfo *trans_info); -/*@}*/ +/**@}*/ diff --git a/src/import-export/import-settings.c b/src/import-export/import-settings.c index a923de295c..2e68a35f96 100644 --- a/src/import-export/import-settings.c +++ b/src/import-export/import-settings.c @@ -16,8 +16,11 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/**@file - @brief import-settings.c: User preference handling for +/** @addtogroup Import_Export + @{ */ +/**@internal + @file import-settings.c + @brief User preference handling for transaction matching (for both the gui and the backend) @author Copyright (C) 2002 Benoit Grégoire */ @@ -177,3 +180,5 @@ gint gnc_import_Settings_get_display_threshold (GNCImportSettings *settings) g_assert (settings); return settings->display_threshold; }; + +/**@}*/ diff --git a/src/import-export/import-settings.h b/src/import-export/import-settings.h index cb87fda043..723942f3c4 100644 --- a/src/import-export/import-settings.h +++ b/src/import-export/import-settings.h @@ -16,8 +16,11 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/**@file - \brief import-settings.h: User preference interface for +/** @addtogroup Import_Export + @{ */ +/**@file import-settings.h + \brief Import preference handling. + *User preference interface for transaction matching (for both the gui and the backend) \author Copyright (C) 2002 Benoit Grégoire */ @@ -31,8 +34,7 @@ typedef struct _genimportsettings GNCImportSettings; * Getter/Setter Functions for the Data Types. ************************************************************************/ -/** @name Getters/Setters for GNCImportSettings */ -/*@{*/ + /** Allocates a new GNCImportSettings object, and initialize it with the appropriate user prefs. @@ -44,6 +46,8 @@ gnc_import_Settings_new (void); void gnc_import_Settings_delete (GNCImportSettings *settings); +/** @name Getters/Setters for GNCImportSettings */ +/*@{*/ /** Return the allowed amount range for fuzzy amount matching. @return The allowed amount range for fuzzy amount matching, @@ -79,7 +83,7 @@ gint gnc_import_Settings_get_add_threshold (GNCImportSettings *settings); /** Return the selected threshold. */ gint gnc_import_Settings_get_display_threshold (GNCImportSettings *settings); - -/*@}*/ +/**@}*/ +/**@}*/ #endif diff --git a/src/import-export/import-utilities.c b/src/import-export/import-utilities.c index c0f8af2b68..bb4ecb07cb 100644 --- a/src/import-export/import-utilities.c +++ b/src/import-export/import-utilities.c @@ -16,8 +16,11 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file - @brief import-utilities.h: Utility functions for writing import modules. +/** @addtogroup Import_Export + @{ */ +/** @internal + @file import-utilities.c + @brief Utility functions for writing import modules. @author Copyright (C) 2002 Benoit Grégoire */ #define _GNU_SOURCE @@ -106,3 +109,4 @@ void gnc_import_set_trans_online_id(Transaction * transaction, return; } +/* @} */ diff --git a/src/import-export/import-utilities.h b/src/import-export/import-utilities.h index 43bf48a273..c2bfad0c61 100644 --- a/src/import-export/import-utilities.h +++ b/src/import-export/import-utilities.h @@ -16,8 +16,10 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ -/** @file - @brief import-utilities.h: Utility functions for writing import modules. +/** @addtogroup Import_Export + @{ */ +/** @file import-utilities.h + @brief Utility functions for writing import modules. @author Copyright (C) 2002 Benoit Grégoire */ #ifndef IMPORT_UTILITIES_H @@ -25,14 +27,27 @@ #include "Account.h" -/* Setter and getter functions for the online_id kvp_frame for - Accounts and Transactions. +/** @name Setter-getters + Setter and getter functions for the online_id kvp_frame for + Accounts. + @{ */ const gchar * gnc_import_get_acc_online_id(Account * account); void gnc_import_set_acc_online_id(Account * account, const gchar * string_value); +/** @} */ +/** @name Setter-getters + Setter and getter functions for the online_id kvp_frame for + Transactions. + @{ +*/ const gchar * gnc_import_get_trans_online_id(Transaction * transaction); void gnc_import_set_trans_online_id(Transaction * transaction, const gchar * string_value); +/** @} */ #endif +/** @} */ + + + diff --git a/src/import-export/ofx/gnc-ofx-import.c b/src/import-export/ofx/gnc-ofx-import.c index 45526098e1..be239d5967 100644 --- a/src/import-export/ofx/gnc-ofx-import.c +++ b/src/import-export/ofx/gnc-ofx-import.c @@ -16,10 +16,11 @@ * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ - /** @file +/** @addtogroup Import_Export + @{ */ +/** @internal + @file gnc-ofx-import.c @brief Ofx import module code - * - gnc-ofx-import.c @author Copyright (c) 2002 Benoit Grégoire */ #define _GNU_SOURCE @@ -157,6 +158,7 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data) gchar *investment_account_text; gnc_commodity *currency=NULL; gnc_commodity *investment_commodity=NULL; + gnc_numeric gnc_amount, gnc_units; GNCBook *book; Transaction *transaction; Split *split; @@ -363,10 +365,12 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data) split=xaccMallocSplit(book); xaccTransAppendSplit(transaction,split); xaccAccountInsertSplit(account,split); - /*gnc_amount = double_to_gnc_numeric(data.amount,xaccAccountGetCommoditySCU(account),GNC_RND_ROUND);*/ + + gnc_amount = double_to_gnc_numeric (data.amount, + gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)), + GNC_RND_ROUND); + xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction)); - DxaccSplitSetBaseValue(split, data.amount, currency); - /* Also put the ofx transaction's memo in the split's memo field */ if(data.memo_valid==true){ xaccSplitSetMemo(split, data.memo); @@ -404,7 +408,15 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data) split=xaccMallocSplit(book); xaccTransAppendSplit(transaction,split); xaccAccountInsertSplit(investment_account,split); - DxaccSplitSetSharePriceAndAmount(split, data.unitprice,data.units); + + gnc_amount = double_to_gnc_numeric (-(data.amount), + gnc_commodity_get_fraction(investment_commodity), + GNC_RND_ROUND); + gnc_units = double_to_gnc_numeric (data.units, + gnc_commodity_get_fraction(investment_commodity), + GNC_RND_ROUND); + xaccSplitSetAmount(split, gnc_units); + xaccSplitSetValue(split, gnc_amount); if(data.security_data_ptr->memo_valid==true) { @@ -475,7 +487,11 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data) split=xaccMallocSplit(book); xaccTransAppendSplit(transaction,split); xaccAccountInsertSplit(income_account,split); - DxaccSplitSetBaseValue(split, data.amount, currency); + + gnc_amount = double_to_gnc_numeric (data.amount, + gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)), + GNC_RND_ROUND); + xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction)); /* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */ if(data.name_valid==true){ @@ -493,8 +509,11 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data) split=xaccMallocSplit(book); xaccTransAppendSplit(transaction,split); xaccAccountInsertSplit(account,split); - /*gnc_amount = double_to_gnc_numeric(data.amount,xaccAccountGetCommoditySCU(account),GNC_RND_ROUND);*/ - DxaccSplitSetBaseValue(split, data.amount,currency); + + gnc_amount = double_to_gnc_numeric (data.amount, + gnc_commodity_get_fraction(xaccTransGetCurrency(transaction)), + GNC_RND_ROUND); + xaccSplitSetBaseValue(split, gnc_amount, xaccTransGetCurrency(transaction)); /* Also put the ofx transaction name in the splits memo field, or ofx memo if name is unavailable */ if(data.name_valid==true){ @@ -610,3 +629,5 @@ int ofx_proc_account_cb(struct OfxAccountData data) return 0; } + +/** @} */ diff --git a/src/import-export/ofx/gncmod-ofx-import.c b/src/import-export/ofx/gncmod-ofx-import.c index 8f183e090a..8158361056 100644 --- a/src/import-export/ofx/gncmod-ofx-import.c +++ b/src/import-export/ofx/gncmod-ofx-import.c @@ -1,6 +1,27 @@ - /**@file - \brief module definition/initialization for the ofx importer - \author Copyright (c) 2002 Benoit Grégoire bock@step.polymtl.ca +/********************************************************************\ + * 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 * + * the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License* + * along with this program; if not, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * +\********************************************************************/ +/** @addtogroup Import_Export + @{ */ + /**@internal + @file gncmod-ofx-import.c + @brief module definition/initialization for the ofx importer + @author Copyright (c) 2002 Benoit Grégoire bock@step.polymtl.ca */ #include #include @@ -66,3 +87,4 @@ libgncmod_ofx_LTX_gnc_module_end(int refcount) { return TRUE; } +/** @}*/