Live data from Hacker News

Double-entry bookkeeping as a directed graph

matheusportela.com

241–250 of 388 posts

Re: Double-entry bookkeeping as a directed graph

#242
post #2

Hi, all! I'm not an accountant but decided to study double-entry bookkeeping and basic accounting a while ago. I learned a lot from many places, including great threads here on HN, and wanted to give back to the community. In this article, I explain the mechanics of double-entry bookkeeping and how I came to realize it's a directed graph. I know there are many accounting nerds on HN so please feel free to criticize o…

Great article. I would love an RSS feed or place to subscribe on your site so I can be sure to read the next in the series

Re: Double-entry bookkeeping as a directed graph

#243
post #214

Earlier quoted context omitted.

Yes, sorry, I was defending the established terminology without making clear why. My problem is that your alternatives don't just change the words, they change the logic. The invariant of debit/credit is that they need to balance out. If you choose words that can occur on both sides of the equation then this is no longer true and you're throwing out a lot more than just the admittedly unintuitive meanings of these wo…

> My problem is that your alternatives don't just change the words, they change the logic. No, they don't. They just change the words you need to express the logic. > The invariant of debit/credit is that they need to balance out. Sure. So? If I give you a dollar, that's going to balance whether we call that a debit to me and a credit to you or a credit to me and a debit to you. The labels don't matter.

What matters is that the labels are different on each side of the equation.

That contradicts your suggestion that we should use the intuitive meaning of the words and it contradicts your suggestion to 'just use "credit" for any increase, and "debit" for any decrease'.

Let's say a company raises equity (i.e it issues new shares), money comes into the bank account. In traditional terminology that would result in:

  debit bank
  credit equity
According to your suggestions, however, raising equity would result in

  increase bank
  increase equity
This violates the principle that the sum of labelAs need to cancel out (or balance out) the sum of labelBs. And this is why I said that you're changing the logic.

Re: Double-entry bookkeeping as a directed graph

#244

I think people underestimate the beauty and impact of accounting. Just a tiny number of formulas (accounting identities [1]) and statements (P&L, balance sheet, etc.) can represent what's going on in any org in ways that can be roughly comparable. Reminds me of the "fundamental theorem of calculus" or "central dogma of biology". Accounting is also where we get math and written language [2] as ancient Mesopotamian civ…

On the other hand some things in how accounting is traditionally done suffer from accounting predating a lot of "modern" math. Negative numbers were first used around the 3rd century in China and took until the 16th century to be used in Europe. Modern double-entry bookkeeping was invented in the 14th century in Europe. So if you ever wonder why they traditionally use a column for debit and one for credit, with defin…

I also kind of like the double column approach with positive numbers, since neither party is exchanging "negative money", so it kind of underscores the balanced nature of the transaction.

Re: Double-entry bookkeeping as a directed graph

#245
Double-entry bookkeeping is the original CRDT.

Just by maintaining a local invariant -- debits and credits in a transaction sum to zero -- a distributed network of agents attending to their own ledger can reliably maintain a global consistent state (like, money is neither created nor destroyed), or heal it in the case of corruption.

Re: Double-entry bookkeeping as a directed graph

#246
post #220

Earlier quoted context omitted.

The -5 doesn't belong in your ledger, it belongs in the ledger of the person who bought the lemonade. As other commenters have pointed out, the "double entry" refers to multiple entries within your own ledger, it has nothing to do with someone else's ledger.

> The -5 doesn't belong in your ledger, it belongs in the ledger of the person who bought the lemonade. This is just prescriptive (do it because I say so). It doesn't explain anything. > As other commenters have pointed out, the "double entry" refers to multiple entries within your own ledger, it has nothing to do with someone else's ledger. I didn't introduce the other guy's ledger, but since you did: I lost lemonad…

Inventory is an asset, so if you want to account for inventory in this example, you would record two debits and two credits:

- $5 debit to cash (asset => debit means +5)

- $5 credit to revenue (equity => credit means + 5)

- $X debit to cost of goods sold (liability => debit means - X)

- $X credit to inventory (asset => credits mean - X)

Where X is the cost of the materials that went into the lemonade. So if X

    Assets = Liabilities + Equities
    (5 - X) = (-X) + (5)
So it all adds up to 0, but you make a (gross) profit or loss depending on the value of X.

You wouldn't account for the customer's side of things because the customer is not on your books.

Re: Double-entry bookkeeping as a directed graph

#247

Ten years in SAP working on FI, SD and AA. (not anymore, I'm done with that) The post triggered PTSD and I want to go home and cry. You created your double entry, cool, now let's split it (because of million reasons) and add taxes. So now we deal with a basic 25 line document where some lines are doing nothing but move funds through certain tax accounts. Oh, no, there is a typo, but we cannot just create the reversal…

> Walmart (who has every line item sold posted to SAP system when you buy things at store) Shudders

On the other hand, people who work on that don't think GPT will make them jobless. Also, I recall how a major client postponed adoption of a new reporting platform because it meant for them layoffs in accounting department and accountants started to sabotage the whole thing...

Re: Double-entry bookkeeping as a directed graph

#248
post #205

Earlier quoted context omitted.

> Of course it would be, asset is anything of value, you're confusing with subtypes of assets. Just mujhe liability is anything you owe regardless of for how long If an office buys snacks on Monday for the office party on Friday, they're not counting it as an asset and depreciating it on their books. If food production or delivery were part of the core business, it would be one thing, but in the context that OP's tal…

Depreciation isn't relevant here, again, you're confused in the types of assets, not all of them are depreciated, only some with some specific properties like time of expected user. Just read the definition of assets in any (accounting) dictionary, or try to record your snack purchase in real accounts and see which side of the balance sheet this account end up in (hint: inventories, assets).

Do you actually do that? When people are working late at the office and you order pizzas you put that into your inventory and then remove it as people consume the pizzas? I record that into a separate operating expenses account meant for this kind of fringe benefit, not into inventory.

Pretty small so I do the accounting as well, but I think I'd lose my mind if I had to record them into inventory. Then when they leave half the pizzas for the next day, I record that? No way.

Re: Double-entry bookkeeping as a directed graph

#249
post #103
post #88

Earlier quoted context omitted.

Every time money is exchanged, it has to come from somewhere and it has to go somewhere -- that's two places it need to be recorded (or "entered in the books"). Money can not be created out of thin air, and it can not be destroyed. Every movement of money has to be accounted for, which is why it's called "accounting". Double-entry accounting means you have to account for where the money comes from, and you have to ac…

> Where it can become confusing is when money leaves you or comes in from an external source. There are still two entries, but one entry is in one party's books and the other entry is the other's. For example, I get a paycheque and I enter my income in a little book with green paper and DB/CR columns. At the same time, my employer has entered an expense in their book. Double entries. NO. I mean your employer probably…

Well, if I have a local entry

    ACME, inc Employment Income   $100 DEBIT
in my employment income account that money has not come out of thin air. Remember, money can not be created nor destroyed in this system. Somewhere there is a matching entry something like

    bregma, services rendered     $100 CREDIT
in my employer's books. And that money, in turn, was probably moved in from some other account internally. Mean time the only real movement of "money" was an electronic communication between two banks (my employers and mine), with a matching entry in an account in each.

Things like income accounts and expense accounts are not magic sources or sinks for money flows. They're just half of a double entry system with the other half somewhere else.

Re: Double-entry bookkeeping as a directed graph

#250

Earlier quoted context omitted.

The accounting equation is the right thing to think about. People want debit and credit to mean something more than they need to. My 100-level accounting instructor said it pretty succinctly: Debit means an entry in the left column. Credit means an entry in the right column. What a transaction means for the business depends on the accounts.

It sounds like your accounting instructor may have focused too much on implementation details (left/right), and too little on accounting principles. The terms debit and credit have meaning independent of their columnar position on a traditional ledger. I could create a ledger with the columns reverse or (shocking!) use a computer program with a data structure that doesn't encode the concept of left or right. I think…

That's too simple. That logic roughly works the balance sheet. However, it says nothing about the income statement.

For the income statement, CR -> revenue and DR -> expense.

Post reply on HN