Hacker News new | ask | show | jobs
by omichowdhury 806 days ago
Yeah, I think a more intuitive way is to replace credit and debit with State and Change as the pair of things in double-entry. It means that you don't have to swap meanings based on context and can use negative numbers intuitively.

State Accounts track your net worth

  Assets: what you own

  Liabilities: what you owe
Change Accounts track why your net worth changes

  Income: what you've earned

  Expense: what you've spent
The accounting equation that follows is ∆ State = ∆ Change:

  Assets - Liabilities = Income - Expense

Selling lemonade is +$5 Asset balanced by +$5 Income. If you substitute into the equation, it's: $5 Asset = $5 Income

Taking out a loan is +$10 Asset balanced by +$10 Loan. In the equation: $10 Asset - $10 Liability = $0.

In general, say you have a +Asset action, to balance the equation you can do it 4 ways:

  +Asset -Asset aka swapped for equal value

  +Asset +Liability aka took out a loan

  +Asset +Income aka sold something

  +Asset -Expense aka got a refund
I've left out Equity as a separate account type since you can just treat it mathematically as a Liability account.

This is the system we've implemented in our ledger API (https://fragment.dev)

1 comments

> +Asset +Income aka sold something

Don't you mean -Asset here?

Nope, in these examples the +Asset on the left means you received say cash. The right side shows various ways to balance that out based on the accounting equation

I did an explanation with numbers here: https://news.ycombinator.com/item?id=40021506

> in these examples the +Asset on the left means you received say cash.

Ah. So... where is the value of the lemonade before you sold it? Wasn't that an asset before you sold it?

I guess technically this would be selling a service instead of a good.

I was going through the 4 combinations of balanced two-line entries, based on the accounting equation, to show how it helps when thinking through how to record something.

If you get into more than two lines, then yup selling a good would be

  +Asset -Asset +Income
or if you include sales tax and son shipping costs:

  +Asset -Asset +Liability +Income +Expense
Using an updated accounting equation and negative numbers is a lot more intuitive than credits and debits. In this larger example it tells you:

  Cash Asset - COGS Asset - Tax Liability = Sales Income - Shipping Expense

It tells you what types of accounts balance, with a syntax that matches your intuitions: more asset = good, less asset = bad, more expense = bad, less expense = good.
> I guess technically this would be selling a service instead of a good.

LAAS!

Sorry, no, lemonade is not a service. It is true that you are adding value by turning lemons into lemonade, but that's not what you're selling. You're selling the lemonade. LAAS would be turning someone else's lemons into lemonade for them, but a typical lemonade manufacturer owns their raw materials.

I completely forgot what the original post I was replying to was about lol. If it was about lemonade then yup the lemons and the lemonade should be on the books as assets.

I’ve also wondered what to do if you grow your own lemons. I guess you could offset the new asset on your books with a Harvest income account?

One of our customers built an ERP for food distributors, I should ask them how they would handle it.