Live data from Hacker News

Double Entry Accounting for Developers

django-hordak.readthedocs.io

211–220 of 237 posts

Re: Double Entry Accounting for Developers

#211
post #84
post #8

Earlier quoted context omitted.

Even bullet 4 has assets and expenses multiplied by -1. Completely .... wrong. Maybe this might work for a bank where assets and liabilities are sort of flipped from a non-bank business?

Banks and non-banks don't treat assets/liabilities in different ways in accounting - banks just engage in transactions most other businesses don't, as a normal matter of business. For example - if you're holding someone's money for them, that's a liability - you have to pay it back some time. If someone owes you money, that's an asset - it's worth something. Banks use the cash from liabilities (people's savings accou…

Except Fractionnal Reserve. It kinda throws off the idea, how do they do then ?

Let's see, when they lend money they don't have (which is what it is) they increase the number on your account, that is they create a big liability for themselve. On the other hand they create an asset wich is your debt to them. So accounting-wise, it works out, like theorically I could do that (lending) even if I have €0, it's all paper.

But then you're gonna go and empty that account to buy your house, reducing their liability and taking (reducing) their cash instead... that they don't have !

So how does it work ? Does it just work because you don't actually buy houses with bills and coins but with bank transfers, then just shifting the paper magic to another bank ?

To be honest I know they can do something my broke self can't, and it has to du with central banks, but what is it exactly ? Something like "if everybody happens to empty their account to cash at the same time, don't worry mate we'll print them bills and give them to you, pinky promise" ?

Re: Double Entry Accounting for Developers

#212
post #209
post #204

Earlier quoted context omitted.

I do understand the difference between debit and credit. The point is not whether you can balance the books looking at them when they fit in a single page. The point is that in a balance sheet assets appear as $x (where x is rarely negative, an asset with negative value would become a liability). People want assets to be positive in the balance sheet. This may be a convention but it's a reasonable convention. I don't…

If you are using a negative numbers you can do it in three ways. 1. positive numbers represent the default for an account (A positive number in a debit account is a debit, but a positive number in a liability say, is a credit). This is done a lot. But he causes a lot of rules about when to add and went to subtract what the balance with what. I think this is why they lot of double entry bookkeeping and has a hard repu…

> 2. The approach I'm used to of having negative numbers in the debits and positive credits. This makes all the double accounting balancing much simpler. But I can see it may confuse some people when assets are negative.

So, if people were able to overcome their confusion, would you have balance sheets written like this?

   $ in millions
   
   ASSETS                                        LIABILITIES AND SHAREHOLDERS' EQUITY
   
   Cash and Short Term Investments   -133546     Deposits                      117756
   Other Assets                      -859422     Other liabilities             784947
   ------------                      -------     -----------------             ------
   Total Assets                      -992968     Total liabilities             902703

                                                 Shareholders' equity           90265
                                                 ====================          ======
                                                 Total liabilities
                                                 and shareholders' equity      992968
If you really want to change the signs in one of the sides, so instead of getting the same totals they sum to zero, it would make much more sense to do it the other way: keep assets positive and let liabilities be negative (as other commenters have suggested).

   $ in millions
   
   ASSETS                                        LIABILITIES AND SHAREHOLDERS' EQUITY
   
   Cash and Short Term Investments    133546     Deposits                     -117756
   Other Assets                       859422     Other liabilities            -784947
   ------------                       ------     -----------------            -------
   Total Assets                       992968     Total liabilities            -902703

                                                 Shareholders' equity          -90265
                                                 ====================         =======
                                                 Total liabilities
                                                 and shareholders' equity     -992968
But one property of the usual presentation is lost: equity is no longer equal to net assets (which are $90265mn). You would need to change the sign of equity when considering it as an asset.

Re: Double Entry Accounting for Developers

#213

Earlier quoted context omitted.

> look at your books I think OP is encoding the sign-reversal internally though, right? It "displays" the two incorrectly classified account types exactly per the standard convention instead of re-applying the convention at every operation. All reports would follow the 'Classic' conventions. At least that was my reading!

It doesn't, the Equity account displays a negative number if the company is in the green (it decreases when you emit stocks), the Expense account displays positive numbers (it increases when you spend money), the Income account displays negative numbers (it decreases when you earn money). In beancount, the accounting equation is Expense+Income+Equity=0 and all signs are always left intact (there is only addition). So…

FWIW I did an accounting elective at college and ran the books for a small business for a couple of years. I'm comfortable with the conventions :-) I was just saying OP was choosing to encode the conventions differently internally and display them a different way to meet the external convention, like GMT+TZ. You need never known your computer stores time in GMT and most people don't, even the accountants.

Re: Double Entry Accounting for Developers

#214
post #149

Earlier quoted context omitted.

If your banana is for consumption and you pay cash: Then debit Food Expenses (decrease equity) and credit Cash (decrease assets). Accounting equation is balanced. If your banana is for resale and you pay cash: Credit Cash (decrease assets) and Debit Trading Stock (increase assets). Accounting equation is balanced. If your banana is for consumption and you buy it on credit from your supplier: Credit Loan account (incr…

It doesn’t quite. You’ll also need to consider allocations and accounting for tax (sales and income), depreciation, transaction fees, warehousing, shipping revenue and expenses, revenue and expense recognition, discounts, returns, overpayments, prepayments, futures, chargebacks, refunds, credit notes, invoicing, subscriptions, subsidies, tariffs, reconciliation, adjustments in the current financial year, adjustments…

Apples and oranges. By way of analogy, the OP was talking about C while you are describing building a commercial Windows app. DE accounting is a simple tool that can be used in complex ways.

Re: Double Entry Accounting for Developers

#215

Earlier quoted context omitted.

> >accountants don’t like negative numbers. > That’s the first I hear of that It might be more accurate to say that Western accounting evolved before the concept of negative numbers became widely accepted in the Western world. Negative numbers were invented (or "discovered", depending on your preferences in the philosophy of mathematics) in China, and from there spread to India, and from India to the Islamic world by…

> And accountants do use negative numbers. But, maybe if modern Western accounting had developed in a culture that looked on negative numbers more positively (excuse the pun), they might use them much more than they do? The division of accounts into credit- and debit-normal with a strong anti-negative-entry bias (to the point of contra sub-accounts for recurrent activities that go in the opposite direction of the par…

Gee, you're the first in the whole thread to have actual arguments instead of "B-B-But, you're wrong, I can tell because school told me !", thank you for that (and making me reconsider my position) !

Re: Double Entry Accounting for Developers

#216
post #52

Earlier quoted context omitted.

Debit is where you put money. Credit is where it came from. I am not inventing this. Money in your bank is debit in _your_ accounting. You are very welcome to treat it as positive and add. As long as you keep track of where every positive number is a credit or a debit, and you learn all the rules about which accounts to add and which ones need taking away. Or you can just treat credits as positive numbers and debits…

I think you're confused on what I'm confused about. The positive or negative sign isn't the issue. You could flip all the signs and I'd still have the same problem. > Literally the only 'weirdness' is that money you have put somewhere for future use (like a bank) is negative. But that is literally what I'm talking about. Whether the sign is positive or negative isn't the issue. It just makes no sense for this to be a…

If you receive money out of the blue, then you credit your "Received Money Out of the Blue" account and debit your "Cash" account.

An account doesn't have to be money that you actually owe someone and have to pay back, but regardless of whether you have to pay the money back or not, you still want to track where the money came from and where you put it.

The amounts have to balance because you can't create or destroy money unless you are the Federal Reserve.

Re: Double Entry Accounting for Developers

#217
post #195

I think I understand the mechanics of double entry bookkeeping, but what I find confusing about it is that it is the redundancy. People emphasize the error detection, but these errors can only exist in the first place because of the requirement to record each transaction twice. Also you get a lot of "fictious" or virtual accounts that don't correspond to concrete piles of cash or bank accounts. It seems much easier t…

I agree, I don't understand how creating two entries in two separate locations is a good thing. You have to constantly monitor that you have matching entries everywhere. No thanks. Instead, have a master list of transactions with money in/out in each transaction. As long as every transaction balances, you are golden. Balances, history, cash flow, etc. can all be figured out from this one central location. This is how…

I haven't used ledger, but it seems to be double entry accounting too. According to the example:

    2015/10/12 Exxon
        Expenses:Auto:Gas         $10.00
        Liabilities:MasterCard   $-10.00
whereas I would have something like:

    2015/10/12   Exxon  $10.00  MasterCard  ->  Gas 
The idea would be that the form of the transaction doesn't allow you to screw up - it is neccessarily balanced because you only give the amount once. A bit like a typed language only allows well-formed programs to run.

Re: Double Entry Accounting for Developers

#218
post #133

I think I understand the mechanics of double entry bookkeeping, but what I find confusing about it is that it is the redundancy. People emphasize the error detection, but these errors can only exist in the first place because of the requirement to record each transaction twice. Also you get a lot of "fictious" or virtual accounts that don't correspond to concrete piles of cash or bank accounts. It seems much easier t…

> People emphasize the error detection, but these errors can only exist in the first place because of the requirement to record each transaction twice. That's like saying that check digits in credit card numbers detect errors that only exist in the first place because we entered more digits. Or that checking the md5sum after downloading a binary file detects errors that only exist in the first place because we downlo…

Not really. In double entry bookkeping you have to always add every entry "twice" (I'm not sure how prevalent it is to have split entries, $20 in one and $10+$10 in another - I've learned in school that you don't do that).

I'm just suggesting a different entry format where you enter the number once and the computer creates both bookkeeping entries. Yeah you have the chance to make a typo, but I guess preventing that kind of error is not what this is about, is it?

It's actually not like a checksum, but more like the DRY (don't repeat yourself) principle. Where one framework requires you to define a constant, say a SQL table name, in multiple places, and another lets you type it only once. Like handrolled SQL vs- an ORM. In this case, I think less typing is less error prone.

Re: Double Entry Accounting for Developers

#219

Earlier quoted context omitted.

...but sometimes things aren't inflows or outflows. Depreciation is neither, yet it's (almost) fundamental to accounting.

Depreciation is also neither a credit nor a debit. Doesn't one normally handle depreciation by creating an expense account called "depreciation", and recording the depreciation as a debit in the asset account and a credit in the depreciation account? And couldn't one just as easily word that as, "We track the depreciation by creating an account for it, and recording a flow of money into it from the asset's account?"

You often end up with three accounts. Asset (balance sheet), accumulated depreciation (balance sheet), and the depreciation expense account (P&L).

In which case the depreciation is cr. acc. depreciation and dr. depreciation expense.

Re: Double Entry Accounting for Developers

#220
post #133

Earlier quoted context omitted.

> People emphasize the error detection, but these errors can only exist in the first place because of the requirement to record each transaction twice. That's like saying that check digits in credit card numbers detect errors that only exist in the first place because we entered more digits. Or that checking the md5sum after downloading a binary file detects errors that only exist in the first place because we downlo…

Not really. In double entry bookkeping you have to always add every entry "twice" (I'm not sure how prevalent it is to have split entries, $20 in one and $10+$10 in another - I've learned in school that you don't do that). I'm just suggesting a different entry format where you enter the number once and the computer creates both bookkeeping entries. Yeah you have the chance to make a typo , but I guess preventing that…

> Yeah you have the chance to make a typo, but I guess preventing that kind of error is not what this is about, is it?

That's the kind of error it catches, where you entered one of the entries (say, the cash outflow) and not the other (say, the invoice you were paying) or they were not consistent.

Note it's not always as easy as "this number goes into two places". One entry in one account may correspond to multiple entries elsewhere (say, price plus tax). At least that's what I think, nobody told me not to do that or I don't remember...

And it's literaly a checksum.

https://en.wikipedia.org/wiki/Trial_balance

"The purpose of a trial balance is to prove that the value of all the debit value balances equals the total of all the credit value balances. If the total of the debit column does not equal the total value of the credit column then this would show that there is an error in the nominal ledger accounts."

Post reply on HN