📜 ⬆️ ⬇️

Double bra * eyes programmer



Most of us have come across accountants. To many, their terminology seems to be a Chinese literacy, as for the humanities the reverse Polish record. However, having figured it out, you understand how convenient and powerful this tool is.

The article is not academic, but reflects purely my simplistic view, and for those who have already mastered academic articles - it will be uninteresting. Those who are interested in understanding such a simple and powerful tool as a “double entry” - please under the cat.

Let's imagine some kind of structure leading activities that have relationships with the outside world, owning some kind of property. No matter what the structure is. This can be a company, a household, a website, or a simple citizen. Let's say it will be an Internet startup. Let's say we make a platform for trade in elephants. Let's call this project “Slonomarket”.
')
We will not register any legal entity, IP / FOP and other legal actions. Imagine that just a few friends have agreed to launch a similar startup, and conduct their activities "in the garage."

Balance


In order to understand the general picture of finance in our Slonmarket, we have a sign in which we write what we have, what we owe, what we owe, etc. Let's call this plate " balance ", and the lines in our plate are " balance accounts ".

It is obvious that not all yogurts are equally useful. There is a big difference between the bills reflecting money in the cashier from how much money we owe to suppliers. Accordingly, we divide our tablet into two. One will be the so-called " active accounts ", reflecting what we have, what we can dispose of, etc., in the second half we will enter " passive accounts ", where we will reflect our debts to creditors, suppliers, etc. P.

In fact, assets and liabilities (Rzhevsky remain silent!) Are not really property and debts, but for the beginning I propose such a definition so as not to get confused. You can use such an association for memorizing - we can actively dispose of assets. Give money to a casual friend or spend. Forgive the client’s debt (the client’s debt to us is an asset, our debt to the supplier is a liability), to break the machine or to give the car for scrap. It all depends on us. And with liabilities, only passive operations are possible. We can not take and give to the random homeless our duty to the supplier. We need the consent of both the homeless and the supplier.

Slonomarket Balance Example:

Assets:


Liabilities:


Some accounts are surprising, for example, it is not clear why profit in liabilities and losses in assets. This is normal, I will explain below.

I want to draw your attention to the fact that the amount of passive accounts is equal to the amount of active accounts. This property of balance is fundamental. Hence the name itself - balance. If an accountant says that his balance does not converge, then he usually means that his assets and liabilities are not equal, which is the first sign of an error.

Another look at what account will be passive or active:


Assets are what we have, what we spent money on, and liabilities are where the money came from.

From this point of view, we cannot reflect the profit in assets, because in fact it is already there - either in the form of money on hand, or in the form of customer debt, or in any other form. Even if the client paid off and we immediately spent this money on the purchase of elephants at the warehouse - the profit will be in the form of new elephants, but we already have it reflected in the assets. But where did it come from us? We record its origin in liabilities - profit.

Similarly with losses. If we have losses, for example, elephants have been stolen from us, then the origin of these elephants is already reflected in our liabilities. If these were the elephants of which we have already sold but not shipped, they are visible in the paid but not shipped elephants. If we bought them from the founders' money, then in the authorized capital, if we were given them for sale or with a delay, then in the form of debt to the supplier. But where did the money (elephants) go? This is our loss of theft.

From the point of view of the possibility to manage these losses, and the fact that we have them, there is also no contradiction here - we can forgive the thief. We can “hang the debt” on the guard who missed the thieves, and deduct from his salary. We can exchange these losses for insurance payment (if there was insurance). Well, or trite "to cover" the loss of profit, reducing the profit and loss by one amount.

Why is share capital / equity reflected in liabilities?

By origin, we received money from the founder, which means that we somehow “owe” this money to him. Also according to the functions - we can distribute profits, for example, to dividends, or to increase the share capital. Dividends imply that the founder will take them from the company (in the form of assets, money or products or something else), and if we increase the share capital from the profit, it will be as if the founder gave part of the profit due to it to increase the assets of the startup.

If we do not have “extra” profits, but there are losses, and we want to cover these losses, then we will have no choice but to reduce capital. This roughly corresponds to "since the firm has no money, I forgive her part of the debt." Those. if our Slonomarket earned a profit, then it should owe the founder more money, and if he lost money, it becomes due less.

Why so difficult? Because we must have a balance. Both sides of the balance sheet must be equal, so we cannot just take out and throw out some balance sheet items (accounts).

Cheat Sheet by what belongs where:

Property, then what we can dispose of - active accounts
Obligations to us, what we owe - active accounts
Our obligations, what we have - passive accounts
Profit - passive accounts
Losses - active accounts
Income - passive accounts
Expenses - active accounts
Capital, i.e. founders' investments, authorized capital, etc. - passive accounts

Posting


Here we smoothly approached the second fundamental property of the balance - any changes we have relate to at least two accounts. This statement is a direct consequence of the basic property of the balance - both sides of the balance (assets and liabilities) must be equal in sum. Accordingly, if we reduce or increase one side, we must change the other side in the same way. Or we should change another account of the same type (active or passive) but with a different sign (i.e., if we increased some asset and did not change liabilities, then we should decrease some other asset ... similarly with liabilities).

To make sure that it is enough for us to remember that the assets are what we have, and the liabilities are where it came from. Accordingly, in such terms, if we have a certain asset, then it should come from somewhere, and accordingly a similar entry will appear in the liabilities, or another asset will decrease.

Suppose we have a product in stock. But he can not appear just like that. Either we bought it, and then some assets decreased (money on hand, money on the account, etc.), or we were given a loan (with a deferred payment, for sale, etc.) and then we have a new liability for the same amount. We have stolen money? Money has decreased, losses have increased. We gave a loan? We cannot repay a loan without reducing our assets or increasing other liabilities. After all, we have given something away. It was either money, or something borrowed elsewhere (for example, from the founder), or gave some goods to the debt (then the stocks in the warehouse decreased) or we returned the goods taken for sale (reduced the quantity of goods, reduced the debt to the supplier for this product). Always changing two bills.

So we come to the second fundamental concept - wiring .

Posting is an “atomic” operation of changing two accounts for one and the same amount. In paper-based accounting, large books are used in which they record various accounts and transactions with them. Each posting we need to write twice - the first account and the second. This is called a double entry, and gave the name to the accounting method that is the basis for any accounting in our time.

Any operation in which only one account is affected is erroneous (yes, I know about off-balance accounts, but this is a rudiment of regulated accounting resulting from the fact that accountants are not programmers, and in this article I do not consider them as active-passive ones). If you want to make a single record, then either you do not need to do it, or you have lost her soul mate somewhere, or you need to record in the wrong balance (for example, when people start to mix business money and personal money, which is typical of people who have no other founders in business and no good understanding of accounting).

Theoretically, in one wiring there could be for example three accounts, but this would make it too difficult to control the correctness, etc., therefore the atomic operation affects two accounts and only two.

So, we have a balance, which consists of accounts. Accounts are of two types - active and passive. Changes in balance are made by transactions. Posting is an atomic balance sheet transaction, it affects two accounts and changes them for the same amount.

Operation


Each transaction has one or more transactions. In fact, an operation is a set of transactions related to a single sense, a single event (plus information describing the event itself, but for balance we do not need it).
An operation is an entity that reflects the events of the real world. Moving goods, ordering, paying dividends, etc. Those. real operation.
Postings of one transaction must be in one DBMS transaction, and if one posting fails, then the entire operation, i.e. the operation has atomicity.

Suppose we got a batch of elephants. Siberian elephants for 100 rubles, African for 400 rubles and American for 500 rubles. As a result, we have several entries:

1) an increase in debt to the supplier by 100 rubles (liabilities), an increase in Siberian elephants in the warehouse by 100 rubles (asset)
2) an increase in debt of 400 rubles, an increase of the same amount of African elephants in stock
3) increase in debt by 500 rubles and a similar increase in American elephants in stock
4) reducing the supplier’s debt for prepayment of 500 rubles, and reducing our debt to the supplier by the same amount (ideally, such things are done by a separate official document, and yes, I know that the relationship with contractors is active / passive, but let it be here).

All these transactions are tied to a single transaction, and are associated with one event, namely the receipt of goods from the supplier, occur simultaneously, etc.

Document


Usually in any account we display each event in the form of one or several documents. If a document reflects a change in balance, then they are reflected in the form of one or several transactions. The division of transactions related to one document into different operations does not have clear rules and depends on specific accounting objectives.

Debit and credit


Let's look at what we have wiring.

1) Increase the active account, increase the passive (A + P +)
2) Reduction of the active account, reduction of the passive (AP)
3) Decrease and increase of two active accounts (A + A-)
4) Decrease and increase of two passive accounts (P + P-)

It turns out four types of postings. The rest do not satisfy the requirement of maintaining balance. Can we simplify this?

Since we have not invested any sense in the order of accounts, we will write them in a different order:

A + P +
P-A-
A + A-
PP +

What can we notice in common in these wiring?

1) If the active account comes first, it increases, if it is passive, it decreases
2) If in the second place is the active account, then it decreases, if in the second place is the passive account, then it increases
So we have one type of transaction in which two accounts are indicated, let's call them a debited account, and a credited account, and the amount of the transaction.
Well, accordingly, we write down our rules for the action of the transaction:
1) If the debit of the active account, then it increases, if it is passive, then it decreases
2) If the credit is an active account, then it decreases, if a passive account, then it increases

This is exactly the accounting form of balance sheet ends.

Normalize a little more


Let's try to simplify.

Let's write the value of the active account with a positive number and a passive negative one. Simplified structure of the balance sheet will look like this:

ID,
Title,
Type (passive / asset),
Value
And the structure of the posting table, respectively:
ID,
Debit (debited account ID)
Credit (ID of the credited account,
Amount

Checking the integrity of the balance we have even easier - the sum of all accounts should be zero.

Posting rules are simple too:

1) We add the amount of the transaction to the debited account
2) If the account is passive, then we check if it has become positive, if so, then we interrupt the operation and roll back the transaction
3) deduct the amount from the credited account.
4) If the account is active, then we check whether it has become negative, and if so, then we interrupt the operation and roll back the transaction.

Everything. We already have all the basic properties of accounting.

Of course, in a real database, we will add various fields related to the subject area, for example, postings need date / time and connection with the document that generated the posting. Accounts need information about something at the expense of such, and links to other related objects (contractors, goods, etc.), but this is another story.

Perhaps we’ll finish on this, if it’s interesting, then I’ll tell you how to extract information from the balance to the maximum, sort out some examples of operations, etc.

ADF: Separated concept of operation and document. During the discussion of the article it was written here that the operation and the document are the same.

Source: https://habr.com/ru/post/336656/


All Articles