OFX Account not found, only certain account types work

Mike Alexander mta at umich.edu
Sun Nov 11 00:59:22 EST 2007


--On November 10, 2007 6:34:36 PM -0800 Sean F <wsfulmer at gmail.com> 
wrote:

>
>
> doug_mail at hotpop.com wrote:
>>
>> However I am able to get the transactions and balance only for
>> certain account types.
>
> Have you had any luck with this issue? I just spent a solid hour
> setting up aqbanking, and I'm having a similar problem. My checking
> and credit card accounts work fine, but when I try to get a balance
> or transactions from my savings account, I get the "OFX: Account not
> found" error.
>
> I'm certain the account number, etc is correct, and the account
> itself was included when I downloaded the account list during
> AqBanking setup.
>
> Any suggestions?

That's probably because libofx hard codes the account type to CHECKING. 
Here's a patch I use to improve things (although it still only handles 
two account types):

--- inc/libofx.h    2006-11-08 00:18:41.000000000 -0500
+++ inc/libofx.h        2006-11-08 00:59:09.000000000 -0500
@@ -705,6 +705,8 @@
   OFX_BANK_ACCOUNT,
   OFX_INVEST_ACCOUNT,
   OFX_CREDITCARD_ACCOUNT,
+  OFX_CHECKING_ACCOUNT,
+  OFX_SAVINGS_ACCOUNT,
   OFX_INVALID_ACCOUNT
 } AccountType;

--- lib/ofx_request_statement.cpp   2006-11-08 00:30:29.000000000 -0500
+++ lib/ofx_request_statement.cpp       2006-11-08 00:47:17.000000000 
-0500
@@ -61,8 +61,10 @@
   OfxAggregate bankacctfromTag("BANKACCTFROM");
   bankacctfromTag.Add( "BANKID", m_account.bankid );
   bankacctfromTag.Add( "ACCTID", m_account.accountid );
-  bankacctfromTag.Add( "ACCTTYPE", "CHECKING" );
-  // FIXME "CHECKING" should not be hard-coded
+  if (m_account.type == OFX_SAVINGS_ACCOUNT)
+    bankacctfromTag.Add( "ACCTTYPE", "SAVINGS" );
+  else
+    bankacctfromTag.Add( "ACCTTYPE", "CHECKING" );

   OfxAggregate inctranTag("INCTRAN");
   inctranTag.Add( "DTSTART", time_t_to_ofxdate( m_date_from ) );


There was a patch required to aqbanking also, but I think it's included 
in version 2.2.9 already.

-- 
Mike Alexander           mta at umich.edu
Ann Arbor, MI            PGP key ID: BEA343A6
 


More information about the gnucash-user mailing list