About the <trn:currency> tag in the GnuCash file

rhill rhill at raymondhill.net
Tue Mar 5 08:51:06 EST 2013

Hash: SHA1

I am trying to understand as best as I can the exact meaning of all the
fields in the GnuCash file, so I can use the content of the file into an
(experimental so far) app.

I see that each transaction is set into a specific currency, this can be
seen through the <trn:currency> XML field. I would like to understand
why the field has been named "currency" as opposed to "commodity". My
understanding was that the field *had* to be set to a value which is a
subset of the commodities set, the "currency" commodities specifically
(the ones which space is "ISO4217")

However, looking at a particular file, which contains over 14,000
transactions, I noticed there are two exceptions: there are two
transactions (which were entered very recently) where the currency is
not really an ISO4217 commodity, but are a STOCK commodity. So that kind
of invalidate my prior understanding, as it appears that the field
<trn:currency> can refer to any commodity, not just the ones from the
ISO4217 space.

This puzzles me, especially that one of the two transactions has a split
which describes the movement of an amount in a specific ISO4217 currency
(I would have expected the <trn:currency> to be set to that currency),
and I would like for someone to really confirm that indeed, the
<trn:currency> field can refer to more than just an ISO4217 commodity,
or whether it is unexpected that it does so in only two transactions out
of over 14,000 in this particular file.

Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


More information about the gnucash-devel mailing list