r22826 - gnucash/branches/2.4/src/import-export/ofx - [22825] Bug #695423: Fix OFX Commodity Account handling.
Christian Stimming
cstim at code.gnucash.org
Sat Mar 9 05:24:15 EST 2013
Author: cstim
Date: 2013-03-09 05:24:14 -0500 (Sat, 09 Mar 2013)
New Revision: 22826
Trac: http://svn.gnucash.org/trac/changeset/22826
Modified:
gnucash/branches/2.4/src/import-export/ofx/gnc-ofx-import.c
Log:
[22825] Bug #695423: Fix OFX Commodity Account handling.
Patch by Burke.
Modified: gnucash/branches/2.4/src/import-export/ofx/gnc-ofx-import.c
===================================================================
--- gnucash/branches/2.4/src/import-export/ofx/gnc-ofx-import.c 2013-03-09 10:22:18 UTC (rev 22825)
+++ gnucash/branches/2.4/src/import-export/ofx/gnc-ofx-import.c 2013-03-09 10:24:14 UTC (rev 22826)
@@ -318,7 +318,10 @@
Account *account;
Account *investment_account = NULL;
Account *income_account = NULL;
- gchar *investment_account_text;
+/***CPC 20130207 ref: OFX Commodity Account Patch, Burke***
+ gchar *investment_account_text;************************/
+/***CPC 20130207 ref: OFX Commodity Account Patch, Burke***/
+ gchar *investment_account_text, *investment_account_onlineid;
gnc_commodity *currency = NULL;
gnc_commodity *investment_commodity = NULL;
gnc_numeric gnc_amount, gnc_units;
@@ -524,13 +527,28 @@
in any translations. */
_("Stock account for security \"%s\""),
data.security_data_ptr->secname);
+/***CPC 20130207 ref: OFX Commodity Account Patch, Burke***/
+ investment_account_onlineid = g_strdup_printf( "%s%s", data.account_id, data.unique_id);
- // @FIXME: Add the automated selection or creation of account here!
+/***CPC 20130207 ref: OFX Commodity Account Patch, Burke***
+* // @FIXME: Add the automated selection or creation of account here!
+*
+* // First check whether we can find the right investment_account without asking the user
+* investment_account = gnc_import_select_account(NULL,
+* data.unique_id, FALSE, investment_account_text,
+* investment_commodity, ACCT_TYPE_STOCK, NULL, NULL);
+***********************************************************/
- // First check whether we can find the right investment_account without asking the user
- investment_account = gnc_import_select_account(NULL,
- data.unique_id, FALSE, investment_account_text,
- investment_commodity, ACCT_TYPE_STOCK, NULL, NULL);
+/***CPC 20130207 ref: OFX Commodity Account Patch, Burke***/
+ investment_account = gnc_import_select_account(NULL,
+ investment_account_onlineid,
+ 1,
+ investment_account_text,
+ investment_commodity,
+ ACCT_TYPE_STOCK,
+ NULL,
+ NULL);
+
// but use it only if that's really the right commodity
if (investment_account
&& xaccAccountGetCommodity(investment_account) != investment_commodity)
@@ -615,6 +633,8 @@
PERR("No investment account found for text: %s\n", investment_account_text);
}
g_free (investment_account_text);
+/***CPC 20130207 ref: OFX Commodity Account Patch, Burke***/
+ g_free (investment_account_onlineid);
investment_account_text = NULL;
if (investment_account != NULL &&
More information about the gnucash-changes
mailing list