Hacker News new | ask | show | jobs
by rthomas6 1406 days ago
My non-expert understanding for number 1 is that you would record the widget account in denominations of widgets, and separately, record the widget cost for that transaction. That's what you do in beancount anyway, which is what I use for home budgeting. Like this:

  2022-08-17 * "Purchase Widgets"
    Assets:Cash                  -100.00 USD
    Assets:Inventory:Widgets      10 WIDGET {10 USD}
Number 2 is just the reverse:

  2022-08-18 * "Sell Widget"
    Assets:Cash                   20 USD
    Assets:Inventory:Widgets      -1 WIDGET {20 USD}
Probably there's some other more professional way to do it, but this is what makes sense to me, and it's double entry.
1 comments

Wouldn't that lead to a negative inventory value when the number of widgets is still positive?
No, because the inventory value is denominated in widgets, not USD.

What's important is that each transaction balances to zero. It doesn't have to balance across transactions.