AUDIT: r22825 - gnucash/trunk/src/import-export/ofx - Bug #695423: Fix OFX Commodity Account handling.

Christian Stimming cstim at code.gnucash.org
Sat Mar 9 05:22:20 EST 2013


Author: cstim
Date: 2013-03-09 05:22:18 -0500 (Sat, 09 Mar 2013)
New Revision: 22825
Trac: http://svn.gnucash.org/trac/changeset/22825

Modified:
   gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c
Log:
Bug #695423: Fix OFX Commodity Account handling.

Patch by Burke.
BP

Modified: gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c
===================================================================
--- gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c	2013-03-06 20:28:58 UTC (rev 22824)
+++ gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c	2013-03-09 10:22:18 UTC (rev 22825)
@@ -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;
@@ -531,13 +534,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)
@@ -622,6 +640,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