Menu Home

Accounting in Plain Text, Part 3

Hledger does not come with a pre-configured chart of accounts. The chart is actually built from the information contained in the plain-text journal file. For example, let’s start a new journal with the following entry:

2019/02/01 opening balance
    assets:cash:wells fargo 1234            1000
    equity:opening balance                 -1000

This entry creates two accounts. The first is the wells fargo 1234 account, which is actually a third-level account under assets:cash. The other is the second-level opening balance account under equity.

Once you have created a journal, you can ask hledger to list all of the active accounts with the following command:

$ hledger accounts
assets:cash:wells fargo 1234
equity:opening balance

One thing I would recommend is to only use lowercase letters in journal entries, especially when naming accounts. Hledger is case-sensitive. So for instance, let’s say I made a second journal entry like this:

2019/02/02 client fee
    assets:cash:Wells Fargo 1234             150
    income:revenue                          -150

Hledger would consider the capitalized “Wells Fargo” to be a distinct account from the lowercase “wells fargo” I entered earlier. You can see this by running the accounts command again:

$ hledger accounts
assets:cash:Wells Fargo 1234
assets:cash:wells fargo 1234
equity:opening balance

It’s therefore simpler to just lowercase all account names so you don’t have to remember when–or how–to capitalize any of them.

Assets: Depreciation vs. Section 179 Expense

Hledger is flexible enough so that you can organize accounts however you wish. But for most business bookkeeping purposes, you want to start with five top-level accounts: assetsliabilitiesincomeexpenses, and equity.

In my own business, I file a Schedule C with the IRS as a self-employed individual using the cash method of accounting. The “cash method” simply means I record income and expenses at the actual time of payment. Alternatively, some businesses use the “accrual” method, where sales and expenses are recorded when billed, which isn’t necessarily when they are paid.

Schedule C includes a number of expense categories, which I incorporate into my hledger journal. In reality, I only use a few of the Schedule C categories, and since hledger does not pre-define accounts, the unneeded categories do not actually appear. 

One other thing to note: I don’t have much equipment in my business aside from a couple of computers. Normally, the IRS expects you to depreciate any physical assets, but you can opt to expense them under Schedule C. To put this in hledger terms, if I buy a computer on my credit card and expense it, I would make an entry like this:

2019/02/12 al's computer store, inc.
    expenses:business:section 179          599.99    
    liabilities:credit cards:chase 9999   -599.99

The “Section 179” refers to the section of the federal tax code that allows for expensing asset purchases. 

Now let’s show a similar transaction where the computer will be subject to depreciation over time:

2019/02/12 al's computer store, inc.
    assets:computers:dell inspiron c01     599.99
    liabilities:credit cards:chase 9999   -599.99

As you can see, in this entry I’m treating the computer as an asset rather than an expense. Each year I would then make a separate expense entry to reflect the annual depreciation.

Case Study: Allison’s Journal

To put all this together, here is a new sample journal I created for a hypothetical self-employed individual. This journal simulates this person’s financial activity during their first week in business:

2019/02/01 opening balance
    assets:cash:wells fargo 1234            1000
    equity:opening balance                 -1000

2019/02/02 acme inc
    assets:cash:wells fargo 1234             150  ;  invoice 101
    income:client fees:acme      

2019/02/04 vandalay industries llc
    income:client fees:vandalay             -640  ;  invoice 102
    expenses:other:paypal fees              18.86
    assets:cash:paypal

2019/02/04 transfer to wells fargo
    assets:cash:paypal                      -600
    assets:cash:wells fargo 1234            600

2019/02/06 barry's stationary
    expenses:office:supplies                129.56
    liabilities:credit cards:visa 5678     -129.56

2019/02/08 transfer to personal checking
    equity:owner's draw                     -500
    assets:cash:wells fargo 1234            500

This is pretty easy to follow. Our self-employed person–we’ll call her Allison–started her business on February 1, 2019, by opening a new checking account at Wells Fargo and depositing $1,000. This deposit reflects Allison’s equity in the business.

Fortunately, it was a great first week, as two clients paid Allison right away. She received a check from Acme, Inc., for $150, and a $640 payment via PayPal. Since PayPal charges Allison a processing fee, this is reflected as a business expense in the ledger. You’ll note that Allison categorized this entry as expenses:other:paypal fees. On Schedule C, there is a line for “other” expenses that do not fit within the predefined line items on the form, which in this case includes PayPal fees. Thus, placing paypal fees in a third-level category will help Allison keep better track of her expenses for tax purposes.

For the same reason, you will notice Allison’s purchase of office supplies are categorized as expenses:office:supplies. There is a specific line for “office expenses” on Schedule C that includes any supplies. 

You can also see that Allison added four-digit numbers to the end of her bank and credit card accounts. The reason for this will be made clear in a moment.

Finally, at the end of the week Allison decided to transfer $500 from her business account into her personal checking account. This is reflected as a debit against her equity in the business. Note this is not the same thing as Allison deciding to pay herself a salary out of the business, which some self-employed professionals do. That would be reflected as an expense, not a reduction in equity.

Income Statement

Now that Allison has a first week full of journal entries, what reports can she generate from that data? Perhaps the most useful report is an income statement. This is produced using the hledger is command:

$ hledger is
Income Statement 2019/02/01-2019/02/08

                             || 2019/02/01-2019/02/08 
=============================++=======================
 Revenues                    ||                       
-----------------------------++-----------------------
 income:client fees:acme     ||                150.00 
 income:client fees:vandalay ||                640.00 
-----------------------------++-----------------------
                             ||                790.00 
=============================++=======================
 Expenses                    ||                       
-----------------------------++-----------------------
 expenses:office:supplies    ||                129.56 
 expenses:other:paypal fees  ||                 18.86 
-----------------------------++-----------------------
                             ||                148.42 
=============================++=======================
 Net:                        ||                641.58 

This basically shows Allison’s profit-and-loss for the week. 

Balance and Balancesheet

Another command, hledger bal, produces a report listing the current balances for all accounts:

$ hledger bal

             2271.14  assets:cash
               21.14    paypal
             2250.00    wells fargo 1234
            -1500.00  equity
            -1000.00    opening balance
             -500.00    owner's draw
              148.42  expenses
              129.56    office:supplies
               18.86    other:paypal fees
             -790.00  income:client fees
             -150.00    acme
             -640.00    vandalay
             -129.56  liabilities:credit cards:visa 5678
--------------------
                   0

You can see this command shows the overall hiearchy of accounts and lists each balance separately. This can make it a bit confusing to follow. To clean things up a bit, add the --flat flag after the command as follows:

$ hledger bal --flat

               21.14  assets:cash:paypal
             2250.00  assets:cash:wells fargo 1234
            -1000.00  equity:opening balance
             -500.00  equity:owner's draw
              129.56  expenses:office:supplies
               18.86  expenses:other:paypal fees
             -150.00  income:client fees:acme
             -640.00  income:client fees:vandalay
             -129.56  liabilities:credit cards:visa 5678
--------------------
                   0

But to make things even clearer, Allison can ask hledger to produce a formatted balance sheet by typing hledger bs --flat, which stands for “balancesheet”:

$ hledger bs --flat

Balance Sheet 2019/02/01-2019/02/08

                                    || 2019/02/08 
====================================++============
 Assets                             ||            
------------------------------------++------------
 assets:cash:paypal                 ||      21.14 
 assets:cash:wells fargo 1234       ||    2250.00 
------------------------------------++------------
                                    ||    2271.14 
====================================++============
 Liabilities                        ||            
------------------------------------++------------
 liabilities:credit cards:visa 5678 ||     129.56 
------------------------------------++------------
                                    ||     129.56 
====================================++============
 Net:                               ||    2141.58 

Coming Up in Part 4

Having covered the basics of creating a journal, categorizing accounts, and producing basic reports, in the next post of this series I will discuss searching and sorting through journal data in greater detail.

Categories: Linux Tutorials

Tagged as:

S.M. Oliva

Blog ghostwriter

%d bloggers like this: