Accounting for technical and open source teams

Image showing calculators and accounting and financial planning

Table of Contents

As part of Kharagpur Open source society, we had to make certain expenses and we received donations to promote open source. It becomes very difficult (nearly impossible) to maintain all of it in one person’s head and is often error-prone. Going from maintaining it in one’s head to using google sheets is one of the first steps to improve the process of managing finances. Even though it’s an improvement, it has some issues namely it is single entry accounting system, it can be over-ridden which can create inconsistencies and there is too much reliance on one person who is responsible for maintaining finances. KOSS has transitioned from maintaining finances orally, to using google sheets to using a double entry accounting system. This document helps explain why and how we use double accounting system.

Values

Transparency

Transparency builds trust. Trust helps us work more efficiently since we don’t have to keep questioning someone’s intentions so our energy is channelized into more productive uses.

Immutability

Once a verified transaction is in, no change to the original transaction can happen. Only another transaction can be added on top of it to undo the effects of the previous one.

Distributed Control

When all transactions are open to view for all team members, each one of them is responsible for it’s authenticity.

Avoiding single point of failure

A corollary of “Distributed Control” but expands on the point that every one is a human and can make mistakes. There are times when the person managing the finances forgets things and makes mistakes. Even if such mistakes are unintentional, it’s better to avoid such things altogether.

Timely Payments

Capital is a scarce resource and if someone is willing to do something on credit, care should be taken so as to not overstretch someone’s kindness since they wouldn’t be so kind the next time.

Terminology

Double-entry Accounting

In this system, each transaction is composed of two components of equal magnitude and opposite sign. For example, when you transfer X amount of money from one account to another, the first account gets reduced by X and the second account increases by X. This ensures that there are little discrepancies.

Fundamental Rule of Double-entry accounting

There must always be a debit from at least one account for every credit made to another account.

This is what is meant by “double-entry” accounting: the journal must always balance to zero, with an equal number of debits and credits.

Money never pops in or out of existence; it is always a posting from one account to another.

Assets

The things which you “own”, which you can channelize in areas beneficial to you. For e.g. cash in bank, cash which someone has promised to pay you in future, etc.

Liabilities

The things which you owe to someone. For e.g. cash you promised to pay someone at a future date, etc.

Income

Income is an asset which you receive to perform a function/duty. Specifically not using cash instead of assets since transaction can be done on credit, more on this later.

Expenditure

Expenditure is liability which you have to pay to get some work done. Specifically not using cash instead of assets since transaction can be done on credit, more on this later.

Accounts Payable

Cash which you have to pay someone at a near point in time. Sub-category of Liabilities.

Accounts Receivable

Cash which you have to collect from someone at a near point in time. Sub-category of Assets.

What is an account?

An account is anywhere money can go.

Ex:

2020/03/15        Shreepal Grains Store
    Expenses: Groceries           Rs.  500
    Assets:Cash                   Rs. -500

In this case money goes to the ‘Groceries’ account and gets debited from the ‘Cash’ account while ‘Shreepal Grains Store’ is the payee.

Common Types of Transactions

Recording Income

For simplicity, I strongly recommend recording income only when the cash hits bank account for small teams instead of the more complicated way wherein it is recorded when the “right to collect” is established, one entry recorded in accounts payable while is squared off when the cash hits bank account.

Recording Expenditure

Let’s talk about two cases here.

The simple case is that when the book keeper spends money from team’s bank account on behalf of the team. This should be recorded as an expense and the amount should be deducted from the cash balance.

Another case is that when a member of a team spends money from his bank account on behalf of the team. This should be recorded as an expense and also put in accounts payable since the team will have to reimburse the person for his expenses. The team will then have to transfer money from their bank account to the member’s bank account and add the corresponding entry in accounts payable and cash balance.

Designing a Workflow

What does one need in a workflow?

What are the key ingredients in our workflow?

GitHub Every open source enthusiast/technical team member is comfortable with using GitHub and can easily navigate their way through reading and editing the source files, creating a Pull Request, understanding reviews and getting their PR merged.

HLedger HLedger is the back-end application which powers this entire workflow. It is a powerful, double-entry accounting system that is accessed from the UNIX command line. To use ledger, one needs to create a file in ledger's own textual format and enter a transaction, save and commit it to the git repository. Then use the tool ledger to get the required information about balance sheet, income statement and cash flow statement. We will discuss this tool in detail further along.

CI/CD This will be helpful in summarizing the balance sheet and income statement while also helping to check whether the transactions were entered correctly. We would execute ledger commands in the scripts which would do the above said thing.

Getting Started with Ledger

Installation

sudo apt update
sudo apt install ledger

Purpose of ledger It is to make accounting simple by keeping track of the balances for us while our job is to enter the postings. If an individual posting does not balance, Ledger displays an error and indicates the incorrect posting.

Two aspects of ledger use: updating the journal data file, and using the Ledger tool to view the summarized result of the transactions.

If we wish to see how the summary of the transactions would look like, we would have to issue the command:

ledger -f ledger.dat balance

which would output something similar to:

         Rs. -500.00  Assets:Cash
         Rs.  500.00  Expenses:Groceries
--------------------
                   0

Principals of accounting

Stating where the money goes Recall that every posting will involve two or more accounts. Money is transferred from one or more accounts to one or more other accounts. To record the posting, an amount is subtracted from the source accounts, and added to the target accounts. In order to write a ledger transaction correctly, you must determine where the money comes from and where it goes to. For example, when one is paid a salary, he/she must add money to the bank account and also subtract it from an income account:

1/07       Employer XYZ
    Assets:Cash             Rs.  10,000
    Income:Salary           Rs. -10,000

Why is the Income a negative figure? When you look at the balance totals for your ledger, you may be surprised to see that Expenses are a positive figure, and Income is a negative figure. It may take some time getting used to, but to properly use a general ledger you must think in terms of how money moves. Let’s try to understand why minus sign is there.

When you earn money, the money has to come from somewhere. Let’s call that somewhere “society”. In order for society to give you income, you must take money away (withdraw) from society in order to put it into (make a payment to) your bank. When you spend that money, it leaves your bank account (a withdrawal) and goes to society (payment). This is why Income will appear negative — it reflects the money you have withdrawn from society — and why Expenses will be positive — it is the amount you’ve given back. These additions and subtractions will always cancel each other out in the end, because you don’t have the ability to create new money; it must always come from somewhere, and in the end must always leave. This is the beginning of economy, after which the explanation gets terribly difficult.

Understanding Equity When you first start your ledger, you will likely already have money in some of your accounts. Let’s say there is Rs. 100 in your cash account; then add a transaction to your ledger to reflect this amount. Where will the money come from? The answer: your equity.

01/04    Opening Balance of new financial year
    Assets:Cash               Rs.  100
    Equity:Opening Balances   Rs. -100

In short, your net worth is your current equity. By transferring the money in the ledger from your equity to your bank account, you are crediting the ledger account based on your prior equity. That is why when you look at the balance report, you will see a large negative number for Equity that never changes: Because that is what you were worth (what you debited from yourself in order to start the ledger) before the money started moving around. If the total positive value of assets is greater than the absolute value of your starting equity, it means you are making money.

Tree of Accounts A few major account types you have encountered till now are Assets, Liabilities, Expenses and Equity. And we have used colon (: )to denote that the account to the right of colon is the child of the account to the right of colon. I hope you can extrapolate the pattern and figure out easily that

Key Operations that need to be performed

Let’s see how things work in our sample ledger by creating a file sample.dat

Starting a ledger

Hopefully you have understood the basics and it’s time to get the hands dirty and start a ledger. Suppose we have 10,000 INR currently with us. We would create the file with the following contents:

2020/04/01 * Checking balance
  Assets:Cash                      10,000 INR
  Equity:Opening Balances

Output on running ledger -f sample.dat balance:

          10,000 INR  Assets:Cash
         -10,000 INR  Equity:Opening Balances
--------------------
                   0

Member adding bill to get reimbursement for their expenses

Now we must have a web presence by building a website and hosting it on our own domain right? (Otherwise we would miss all the fun 😉 ). Let’s say one of our gracious friend named Mishra Ji has put his credit card for payment to the domain service provider and did the expense for us. We would add it in our ledger file sample.dat like:

2020/04/05 Domain renew
  Expenses:Internet:Domain           1,000 INR
  Accounts Payable:Mishra Ji

Output on running ledger -f sample.dat balance:

              -1,000 INR  Accounts Payable:Team Member 1
              10,000 INR  Assets:Cash
             -10,000 INR  Equity:Opening Balances
               1,000 INR  Expenses:Internet:Domain
    --------------------
                       0

Accepting donations

After doing a lot of expenses, you would soon run out of money and would have to go seeking for donations. Finding donations is definitely difficult. I sympathize. But recording them shouldn’t be difficult right? This is how we can do it:

2020/10/10 Donations
  Assets:Cash                         10,000 INR
  Income:Donations

To view how much we spend v/s donations we received, run the command ledger -f sample.dat balance ^income ^expenses and it would output:

           1,000 INR  Expenses:Internet:Domain
         -10,000 INR  Income:Donations
--------------------
          -9,000 INR

Don’t get scared by the negative figure. This negative figure as we have explained above is the money we have taken from society. You should be scared if it is positive because then it would mean that money going out was greater than money coming in.

Book keeper handling reimbursements

It’s now time that the semester had ended (time flies so soon when you are having fun). It’s time to cleanup up our not-so-boring activity of book keeping too, right? For that we would need to return the money we owe people. How to get the list of the people we owe money to? Simple. run ledger -f sample.dat balance and check the lines which has Accounts Payable like we have done earlier. The command shows us that we need to repay 1,000 INR to Mishra Ji. After transferring the amount to his bank account, we would do this entry:

2020/12/31 Settle Mishra Ji's tab
  Accounts Payable:Mishra Ji           1,000 INR
  Assets:Cash



          19,000 INR  Assets:Cash
         -10,000 INR  Equity:Opening Balances
           1,000 INR  Expenses:Internet:Domain
         -10,000 INR  Income:Donations
--------------------
                   0

As we can see that now we don’t have any line containing Accounts Payable since we have settled our debts.

Paying Cash Upfront

There are times when the expense is so big and in paper form of cash that it’s not reasonable to ask our team member named Faccha to pay it and collect later. Thus, how we handle this case is that we transfer a rounded off amount to the Faccha’s bank account, ask him to go out and and do the expense while the book keeper records the transaction as a loan to the Faccha like this:

2020/01/05 Cash to purchase furniture
  Accounts Receivable:Faccha             5,000 INR
  Assets:Cash



           5,000 INR  Accounts Receivable:Faccha
          14,000 INR  Assets:Cash
         -10,000 INR  Equity:Opening Balances
           1,000 INR  Expenses:Internet:Domain
         -10,000 INR  Income:Donations
--------------------
                   0

Now he purchased the furniture for 4,500 INR. Then he has to put up a transaction like:

2020/01/05 Furniture Expenses
  Expenses:Furniture                      4,500 INR
  Accounts Payable:Faccha


          -4,500 INR  Accounts Payable: Faccha
           5,000 INR  Accounts Receivable:Faccha
          14,000 INR  Assets:Cash
         -10,000 INR  Equity:Opening Balances
           5,500 INR  Expenses
           4,500 INR    Furniture
           1,000 INR    Internet:Domain
         -10,000 INR  Income:Donations
--------------------
                   0

As you can see this shows two lines namely ‘Accounts Payable’ and ‘Accounts Receivable’ which have to be cancelled off. The book keeper would now ask to transfer the remaining amount to team’s bank account and then he will enter the following transactions:

2020/01/06 Reconcile Faccha's Accounts
  Accounts Payable:Faccha                 4,500 INR
  Accounts Receivable:Faccha


             500 INR  Accounts Receivable:Faccha
          14,000 INR  Assets:Cash
         -10,000 INR  Equity:Opening Balances
           5,500 INR  Expenses
           4,500 INR    Furniture
           1,000 INR    Internet:Domain
         -10,000 INR  Income:Donations
--------------------
                   0



2020/01/06 Collect spare from Faccha
  Assets:Cash                              500 INR
  Accounts Receivable:Faccha



          14,500 INR  Assets:Cash
         -10,000 INR  Equity:Opening Balances
           5,500 INR  Expenses
           4,500 INR    Furniture
           1,000 INR    Internet:Domain
         -10,000 INR  Income:Donations
--------------------
                   0

Current balance sheet

hledger -f 2022-2023.dat bs

Current income statement

hledger -f 2022-2023.dat is

Hope this guide helps. Let me know if you have any doubts or suggestions or improvements.