Help with OFX in Gnucash
dbreiser at me.com
Tue Jul 10 00:12:30 EDT 2012
On Jul 9, 2012, at 6:02 PM, Ngewi Fet wrote:
> Hello everyone,
> I have a question about OFX which I am implementing for Gnucash Mobile for
> Android and
> I need help from anyone more experienced with OFX.
I'm not sure it matters to gnucash, but your <ACCTTYPE> tags are misspelled.
> I export the transactions from the app as bank statement transactions. In
> OFX, this means the
> accounts which the user creates in the app are treated as bank accounts.
> Bank accounts
> do not have any names defined in the OFX schema, only bank ID and account
> ID. Gnucash on
> the other hand supports descriptive account names and so forth. I also see
> that there are "Cash Accounts" in Gnucash,
> but I cannot find any analogous accounts in the OFX standard. Am I missing
> something here?
You're not missing anything. Outside of the investment account handling, OFX has no concept of cash accounts. There are cash withdrawals, ATM deposits and withdrawals, Point Of Sale debits and credits, and general debits and credits. OFX is constructed from the viewpoint of a customer's interactions with various accounts at a financial institution. So money either enters or leaves a given account. Gnucash has a means to let you specify the gnucash account that is the second split of the transaction reported by the bank in the OFX file, but OFX doesn't handle double entry transactions internally. OFX also doesn't handle split transactions at all.
> When importing the OFX file with transactions into Gnucash, it always asks
> you to create a new account
> into which to import the transactions. It correctly identifies that there
> are multiple accounts and requires you to create an account in Gnucash
> (or select an existing one) into which to import the transactions from the
> account for each of the accounts from the file.
> Ideally, I would like Gnucash to simply create the corresponding new
> accounts to those defined the exported OFX and import the transactions for
> each of the accounts accordingly. Is this possible?
I don't think it is possible the way you describe it. Will any new account always be created at the root level of your gnucash account hierarchy? If not, will they always have the same parent at some other point in the tree? (seems unlikely to me that such an assumption would please many users). In any event, doing automatic account creation would require a change to gnucash itself.
> Does anyone know how I can best export OFX so that Gnucash automatically
> picks up both
> the accounts and the transactions within those accounts? Thanks.
One of the problems is that OFX's notion of accounts does not include the concept of another account being the other half of a double entry system. To OFX, there is only one account at a time, and one or more transactions affecting that account. Transfers affect two OFX accounts at a time, but I don't think you want to make every transaction a transfer.
> Attached is a sample file produced by the OFX exporter at the moment.
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
One other thing to consider is that once you've assigned an FITID, a gnucash user won't be able to use a download from their bank to clear/reconcile transactions in the desktop file. Since an FITID exists, and download from a bank results in those transactions being duplicated in gnucash because they'll certainly have different FITIDs from the bank than they will from your app.
dbreiser at me.com
More information about the gnucash-devel