linking gnucash to data in postgres

Benjamin Carlyle benjamincarlyle at optusnet.com.au
Mon Jun 21 09:20:50 EDT 2004


On Mon, 2004-06-21 at 21:38, Joseph Mack wrote:
> > Inventory tracking can be done in terms of purely financial records, if
> > you have the patience. Consider this transaction:
> > > Payable:Supplier $100CR
> > Cost Of Inventory $100DR
> > Bought 10 soccer balls @ $10 each
> > > This kind of inventory handling is the "right way to do it" in financial
> > jurisdictions I'm aware of. 
> I've had no financial training at all.

Heh :) Me neither. This is a hobby for me that started with using
Quicken for my personal accounts and has so far peaked in my reading a
couple of accounting textbooks and the like and lurking on the Gnucash
and Kmymoney2 lists. I'm very much interested in the technology behind
accounting, and how that fits into a generalised information
architecture.

> > The cost is not an expense, however later depreciation and shrinkage are expenses. 
> For several years I thought the entries on my credit card were expenses. 
> I then found out in one of the gnucash manuals that the entries on my
> credit card were a liability.
> OK so for a business the cost of a ball is not an expense, so what is it?

A ball is something you own: An asset. The amount showing on your credit
card is something you owe: A liability (ie a debt). When you buy dinner
at a restaurant it's gone by the end of the meal. That's an expense.
It's money that has left your accounting system. When you buy a house
you layout a whole bunch of money but you get something valuable in
return. Your net worth hasn't change. If the house were to fall down or
lose value, that would be an expense. If the house increased in value it
would be income.

It's all about the accounting equation, the cornerstone of double entry
accounting:

Assets = Liabilities + Owner's Equity

That's a fancy way of saying that Owner's Equity (net worth) = Assets -
Liabilities. No big jump of logic there. Accounting is all about
shifting money between the accounts that make up your assets,
liabilities, and equity. You always modify two accounts at the same
time, which is why it's called "double entry" account keeping.  I won't
get into debits and credits, because that takes a few hours of using the
terminology to get acquainted. Let's just take a few examples of the
accounting equation:

I buy a house. The money either comes from assets I already own (ie,
cash) or from a new liability (ie, a home loan). Let's look at both:

Assets ($300,000 cash) = Liabilities ($0) + Owner's Equity ($300,000
opening balance)
becomes
Assets ($0 cash + $300,000 house) = Liabilities ($0) + Owner's Equity
($300,000 opening balance)

Bingo. My net worth stays the same, and I'm now tracking a $300,000
house in my assets. If, when I sell the house at a later time, I happen
to have made a profit or a loss I'll record it as such:
Assets ($350,000 cash) = Liabilites ($0) + Owner's Equity ($300,000 cash
+ 50,000 income)
That's income. It's affected my net worth.

Now here's the same example with a home loan:
Assets ($0 cash) = Liabilities ($0) + Owner's Equity ($0)
becomes
Assets ($300,000 house) = Liabilities ($300,000 home loan) + Owner's
Equity ($0)

My Owner's Equity (net worth) is still zero, even though I have this
nice house? Well, there's a loan to balance it, isn't there?

If you buy something that you hold onto, you are carrying an asset. Over
time its value may decrease and you'll slowly "expend" the asset without
outlaying any more cash:

We start thusly:
Assets ($20 cash) = Liabilities ($0) + Owner's Equity ($20 opening
balance)
We buy a ball:
Assets ($20 ball) = Liabilities ($0) + Owner's Equity ($20 opening
balance)
The ball will only last a year, so every accounting cycle we deduct a
little value from it:
Assets ($20 ball - $2 ball depreciation) = Liabilities ($0) + Owner's
Equity ($20 opening balance - $2 depreciation expense)
Assets ($20 ball - $4 ball depreciation) = Liabilities ($0) + Owner's
Equity ($20 opening balance - $4 depreciation expense)
...
Assets ($20 ball - $20 ball depreciation) = Liabilities ($0) + Owner's
Equity ($20 opening balance - $20 depreciation expense)

Our net worth is now zero, because the ball has been "used up". We bore
the expense over 10 accounting cycles.

Depreciation is a tricky subject, well worth investigating with someone
who knows what they're talking about in your jurisdiction before
embarking on this kind of accounting setup. This was just a crash
course.

The accounting equation is usually shown on a report called the "Balance
Sheet"

> > Now, let's consider wanting to track the number of balls, too. We could
> > create a currency/commodity that represents balls. The above transaction
> > becomes:
> > Payable:Supplier $100CR
> > Cost Of Inventory $100DR
> > Soccer Balls Received 10balls CR
> > Soccer Ball Inventory 10balls DR
> > Bought 10 soccer balls @ $10 each
> I'd always though of commodities as things traded on stock exchanges, and
> which I know nothing about. I've never thought about how business thinks
> of their stock. 

Well, a commodity is really anything who's "units" can't readily be
distinguished from each other. Gnucash does veer strongly towards the
stocks and bonds concept, though.

> > Now our financial records show that we have 10 balls at a cost value of
> > $100. We use standard reports to show how many "balls rich" we are. We
> > can create transactions for when balls are lost or damaged. We need to
> > do that anyway to keep track of the dollar value of our inventory.
> > Keeping track of the inventory count is just a small stretch further.
> what if you need to keep track of the brand, color and size of the soccer balls?

That can't live in the financial records. Only how much they're worth
and how many of them you have can really be handled by an accounting
setup. What they are and what they mean are tricker concepts :)
Essentially you'd have to have a separate commodity for each brand,
color and size of soccer ball that you wanted to keep track of
individually.

> > When you report your financial position you only take into consideration
> > accounts with dollar values. When you report on your inventory you can
> > report separately on ball counts, their costs, and their depreciation.
> thanks, 

I hope I'm not getting too hardcore for you :)
Be warned: Tracking inventory through purely financial engine is not for
the feint-hearted. I suggest using a tool that is built for the purpose
if you're going to do it yourself.

Benjamin.
Blog: http://members.optusnet.com.au/benjamincarlyle/benjamin/blog



More information about the gnucash-user mailing list