sql & gnucash

Linas Vepstas linas@linas.org
Tue, 26 Jun 2001 22:24:55 -0500


On Tue, Jun 26, 2001 at 02:12:21PM -0400, Derek Atkins was heard to remark:
> linas@linas.org (Linas Vepstas) writes:
> 
> > One posibility is OTP -- open trading protocol.  This was issued
> > by a small company some 3 years back.  Don't know if its dead or allive.
> > It seemed to be designed specifically for communicating the transfer of 
> > 'stuff' from one vendor to another, and resumably, money counts as
> > 'stuff'.   Haven't reviewed it in a long time.
> 
> There is the Internet Open Trading Protocol working group in the IETF
> (www.ietf.org/html.charters/trade-charter.html) which may be what you
> mean, or may have taken this up.

yep. used to be www.otp.org but that's gone.

> Well, it wants a bit more than that, but that would be sufficient,
> IMHO.  For example, what happens if you are trading between two
> commodity accounts (stock/mutual fund/etc)?  You know the
> cost-per-share of one account, and you know the total value of the
> transaction.  However you dont know the cost-per-share in the second
> account.  So, how do you enter this into the gnucash database?
> Currently, gnucash assumes a cost-per-share of $1, which is obviously
> wrong in most cases.

no, not exactly. In the current implementation, we don't track
values, instead amounts.  To avoid certain (relatively obscure)
difficulties with arbitrage, a transaction also needs a single
'common currency' in which to value the amount of each split.
It need not be dollars.

This newer way of storing things is what teh sql backend stores,
although the xml file format still uses the old format.  The
two are consistent in that there is a check in the engine 
the blows a gasket if its wrong. It hasn't blown yet.

Reworking it to the 'right' way requires mods in GUI code
that hasn't been made yet.  Maybe in 1.8 ??

--linas

-- 
Linas Vepstas -- linas@gnumatic.com -- http://www.gnumatic.com/