Null Account and more

Linas Vepstas linas at linas.org
Sun Jul 25 10:50:13 EDT 2004


On Sun, Jul 25, 2004 at 08:41:15AM -0500, Perry Smith was heard to remark:
> Could you explain that to me?

GnuCash attempts to avoid the "gratuituous" introduction of minus signs,
since that leads to all sorts of programming and presentation errors.

To keep things simple, gnucash asks that everything sum to zero.
This avoids the problem of trying to keep track of what's on the "left",
what's on the "right", how to handle multi-column linked equations, etc.

> The documentation (design document) says that the value of an account 
> is equal to the splits in it plus the sum of all of the subaccounts.  

That is correct.

> If some are income and others are expenses, I don't see how that can be 
> true.

Because there is no sign difference between the two.

> The design document also causes me to worry because it does not sound 
> like the engine is using GAP rules.  By that I mean that:
> 
> Liabilities = Assets + Owners Equity

GnuCash uses:

   0 ==  Liabilities + Assets + Owners Equity

> So, the sum of the splits in a transaction do not sum up to 0, they 
> balance out -- which is a more complex question.  

No its not more complex, its (absolutely, totally and completely) identical.

> i.e.  If I pay from 
> an asset (e.g. Cash) to a liability (e.g. Note), the equation looks 
> like:
> 
> -100 (Note Liability account) = -100 (Cash asset account)

No.

> It should not (from an accountant's perspective) look like:
> 
> 0 = -100 (Cash account) + 100 (Liability account)

Accountants don't read source code.  They see the correct values
presented to them in the gnucash reports.   The gnucash displays
things the way an accountant wants to see them, in the correct 
left/right column.

> The same is true for income and expense.  If I pay for gas from my 
> salary income it would look like:
> 
> 100 (salary income) = 100 (gas expense)

That's how its presented in the register/reports.  Internally, its
represented as

  0 == 100 (salary income) + -100 (gas expense)

> But if gas is a child of salary, it seems to me that it would be 
> incorrect:
> 
> +- 100 salary
>  |-+- 100 gas
> 
> would make salary  be 200

Right, which is why we don't do it that way.  Values in income and
expense accounts all have the same sign, and not opposite signs.
Thus, the total is zero, not 200.  

To repeat: income and expense accounts are identical, except for 
column labels.  This allows us to keep the math simple, inside the 
engine; to present the correct info to the user we just fiddle
the column labels.

For example, in the above equity example: most people like to think
they have positive equity, and so that is how gnucash dislays it,
even though internally, and by GAP standards, equity is "negative".


--linas

> 
> On Jul 24, 2004, at 10:02 PM, Linas Vepstas wrote:
> 
> >On Fri, Jul 23, 2004 at 09:31:55AM -0500, Perry Smith was heard to 
> >remark:
> >>So, I'm hearing that an income account can have a child that is an
> >>expense account.  O.k.   That seems odd to me but o.k.
> >

-- 
pub  1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas at linas.org>
PGP Key fingerprint = 8305 2521 6000 0B5E 8984  3F54 64A9 9A82 0104 5933


More information about the gnucash-devel mailing list