DB design document

Dave Peticolas dave@krondo.com
Fri, 15 Dec 2000 02:28:05 -0800


"Phillip Shelton" writes:
> > -----Original Message-----
> > "Phillip Shelton" <shelton@usq.edu.au> writes:
> > 
> > > Therefore we should be able to store the accounts scu's in 
> > the account
> > > table?
> > 
> > I thought the scu was tied to the commodity, not an account.
> > Or did I misunderstand?
> 
> If any one has misunderstood anything it is probably me.
> 
> Can a commodity have more than one scu?  

A commodity object has a single scu, the default scu for that
commodity. However, an Account object has 'overriding' scu
values for both security & currency. When an account is assigned
a currency/security, it's corresponding scu it set to the default
for that commodity. However the account's scu values can be changed
using the engine api.

Generally, as a user you would never need to do this, and the
account scu values would always be the original scu value for
the commodity. However, there are cases where you need to change
them.

The canonical example is that you own (say), partial shares of
the same kind of stock at two different brokerages. The first
brokerage tracks your shares to 3 decimal places, while the
second tracks them to 4 decimal places. Thus, if you want to
make sure that gnucash is tracking your shares at the same
precision as the brokerages, you would need two accounts,
each with the same security, but with different security
scu values.

dave