big change

Dave Peticolas dave@krondo.com
11 Jul 2001 17:13:29 -0700


I have just checked in a large change to the development tree.
This changes the way currencies are handled by the engine.

Previously, every account had a currency and, possibly a
commodity. Transfers between accounts required at least
one common commodity, either currency or security, with
the resulting need for 'currency' accounts to effect
transfers between accounts with different currencies.

Under this scheme, the split 'amount' was denominated
in the account security, if it existed, and the currency
otherwise, while the split 'value' was denominated
in the account currency.

Now, every account has one commodity. This commodity
is the security of the old account, if it had one,
otherwise it is the currency. Split 'amount' fields
are always denominated in the account commodity.

In addition, every transaction has a 'balancing currency'
in which all of the split value fields are denominated.
The transaction currency doesn't have to be related to
the account commodities, thus transfers are allowed
between any accounts without restriction. The double-entry
debit/credit restriction is applied to the value fields.

The 'lower-level' changes involving the engine and file
storage are mostly complete. The gui still needs a lot
of work to make the transition.

Like the change to gnc_numeric from floating point, this
is a fairly extensive change and things are likely to be
wonky for a while. I remind you not to use the unstable
version to track important data!

Stuff that may be broken, or still needs work:

+ QIF importing - choose the appropriate balancing currency

+ RPC backend - this is now broken, I don't know enough about RPC to fix
it

+ SQL backend - I think this is ok, but Linas should check it out

+ Register - user needs a way to see/change the transaction currency
             and to see/change both the value & amount

+ Transfer dialog - I partially fixed this (no longer uses currency
                    accounts), but it still needs more work for an
                    intuitive interface

+ Misc GUI - places where transactions are created (stock split druid,
             opening balances, etc.) need to be extended to allow
             transfers between any account, with a choice of
value/amount
             and balancing currency.

+ Scheduled Transactions - I made few if any changes here. Sched Trans.
                           probably need their own balancing currency?

The major effect for new development is that when transactions are
created, you must specify a balancing currency to use, with
xaccTransSetCurrency. Older format files should be converted
automatically.

dave