Skip to main content

3 posts tagged with "double-entry accounting"

View All Tags

Understanding Receivables and Payables in Beancount

· 3 min read
Mike Thrift
Mike Thrift
Marketing Manager

Hello everyone! In today's blog post, we're diving into the world of Beancount, a double-entry accounting tool that's loved by many for its simplicity and power. More specifically, we're going to talk about two key concepts: Receivables and Payables.

Understanding these terms is crucial to using Beancount (or any double-entry accounting system) effectively. But don't worry if you're a beginner - we're going to break it all down, step by step!

Receivables and Payables: The Basics

2023-05-30-receiveable-and-payable

In accounting, "receivables" and "payables" are terms used to track money that is owed. "Receivables" refers to money that others owe to you, while "payables" refers to money that you owe to others.

Let's take an example:

  1. Accounts Receivable (A/R): Suppose you own a bookstore and a customer buys a book on credit. The money they owe you for the book is an account receivable.

  2. Accounts Payable (A/P): On the flip side, imagine you order a new set of books from a publisher, but you don't pay for them upfront. The money you owe the publisher is an account payable.

In Beancount, these are typically tracked through corresponding accounts. The main benefit here is that it provides you with a clear and accurate picture of your financial position at any point in time.

Setting Up Receivables and Payables in Beancount

The structure of your Beancount file can be as simple or as complex as you need it to be. For receivables and payables, you'll likely want to create separate accounts under your Assets and Liabilities sections.

Here is a simple example:

1970-01-01 open Assets:AccountsReceivable
1970-01-01 open Liabilities:AccountsPayable

Tracking Transactions

Payee side

After setting up your accounts, you can track transactions that involve receivables and payables. Let's look at an example:

2023-05-29 * "Sold books to customer on credit"
Assets:AccountsReceivable 100 USD
Income:BookSales -100 USD

Here, you're adding $100 to your receivables because a customer owes you this amount. Simultaneously, you're reducing your income by the same amount to maintain the balance (since you haven't actually received the money yet).

When the customer eventually pays, you'll record it like this:

2023-06-01 * "Received payment from customer"
Assets:Bank:Savings 100 USD
Assets:AccountsReceivable -100 USD

Payer side

The same principle applies for payables, but with reversed signs:

2023-05-30 * "Bought books from publisher on credit"
Liabilities:AccountsPayable 200 USD
Expenses:BookPurchases -200 USD

And when you pay off your debt:

2023-06-02 * "Paid off debt to publisher"
Liabilities:AccountsPayable -200 USD
Assets:Bank:Checking 200 USD

Wrapping Up

Receivables and payables are at the heart of any accounting system. By accurately tracking these, you gain a comprehensive understanding of your financial health.

This is just a starting point, and Beancount is capable of much more. I hope this blog post helps clarify these important concepts. As always, happy accounting!

Beancount Cheat Sheet

· 2 min read
Mike Thrift
Mike Thrift
Marketing Manager

Example Account Name

Assets:US:BofA:Checking

cheatsheet-en

Account Types

Assets          +
Liabilities -
Income -
Expenses +
Equity -

Commodities

CNY, EUR, CAD, AUD
GOOG, AAPL, RBF1005
HOME_MAYST, AIRMILES
HOURS

Directives

General syntax

YYYY-MM-DD <Directive> <Parameters...>

Opening & Closing Accounts

2001-05-29 open Expenses:Restaurant
2001-05-29 open Assets:Checking USD,EUR ; Currency constraints

2015-04-23 close Assets:Checking

Declaring Commodities (Optional)

1998-07-22 commodity AAPL
name: "Apple Computer Inc."

Prices

2015-04-30 price AAPL   125.15 CNY
2015-05-30 price AAPL 130.28 CNY

Notes

2013-03-20 note Assets:Checking "Called to ask about rebate"

Documents

2013-03-20 document Assets:Checking "path/to/statement.pdf"

Transactions

2015-05-30 * "Some narration about this transaction"
Liabilities:CreditCard -101.23 CNY
Expenses:Restaurant 101.23 CNY

2015-05-30 ! "Cable Co" "Phone Bill" #tag ˆlink
id: "TW378743437" ; Meta-data
Expenses:Home:Phone 87.45 CNY
Assets:Checking ; You may leave one amount out

Postings

  ...    123.45 USD                             Simple
... 10 GOOG {502.12 USD} With per-unit cost
... 10 GOOG {{5021.20 USD}} With total cost
... 10 GOOG {502.12 # 9.95 USD} With both costs
... 1000.00 USD @ 1.10 CAD With per-unit price
... 10 GOOG {502.12 USD} @ 1.10 CAD With cost & price
... 10 GOOG {502.12 USD, 2014-05-12} With date
! ... 123.45 USD ... With flag

Balance Assertions and Padding

; Asserts the amount for only the given currency:
2015-06-01 balance Liabilities:CreditCard -634.30 CNY

; Automatic insertion of transaction to fulfill the following assertion:
2015-06-01pad Assets:Checking Equity:Opening-Balances

Events

2015-06-01 event "location" "New York, USA"
2015-06-30 event "address" "123 May Street"

Options

option "title" "My Personal Ledger"

Other

pushtag #trip-to-peru
...
poptag #trip-to-peru
; Comments begin with a semi-colon

Introduction to Beancount.io

· 5 min read
Mike Thrift
Mike Thrift
Marketing Manager

Why bookkeeping or tracking assets?

Do you manage your investments using a spreadsheet? If so, you should check out beancount.io – an online investment tracker that makes it easy to keep track of your stock and crypto portfolios. Beancount.io is easy to use, and offers a wide range of features that make it the perfect tool for investment tracking. In this post, we'll introduce you to beancount.io and show you how to get started.

2019-09-07-introduction-to-beancount

Expenses

2019-09-07-introduction-to-beancount

2019-09-07-introduction-to-beancount

Income Statement

Balance Sheet

Double-entry Bookkeeping for Correctness

Beancount is built upon double-entry accounting, a widespread technique to track financial information.

To ensure the accuracy and internalize the error detection into the system, double-entry bookkeeping requires every entry to an account has at-least a corresponding entry to a different account. One transaction involves at least two accounts with two operations - debit (+) and credit (-).

1970-01-01 open Income:BeancountCorp
1970-01-01 open Assets:Cash
1970-01-01 open Expenses:Food
1970-01-01 open Assets:Receivables:Alice
1970-01-01 open Assets:Receivables:Bob
1970-01-01 open Assets:Receivables:Charlie
1970-01-01 open Liabilities:CreditCard

2019-05-31 * "BeancountCorp" "Salary of May 15th to May 31st"
Income:BeancountCorp -888 USD
Assets:Cash 888 USD

2019-07-12 * "Popeyes chicken sandwiches" "dinner with Alice, Bob, and Charlie"
Expenses:Food 20 USD
Assets:Receivables:Alice 20 USD
Assets:Receivables:Bob 20 USD
Assets:Receivables:Charlie 20 USD
Liabilities:CreditCard -80 USD

As you can see in the two examples above, every transaction must fulfill the accounting equation.

Assets = Liabilities + Equity(aka Net Assets)

We used the Beancount syntax by Martin Blais and the web project Fava by Jakob Schnitzer to build this website. And it will alert you if any transaction has any legs not summing to zero.

Error Alert

Now you understand how we enforce the correctness of the ledger. But you may ask what are those "accounts"?

Accounts for money as buckets for water

Thinking your assets as water running in and out of different buckets and "accounts" are those buckets holding your money. With double-entry bookkeeping, it becomes obvious how money is flowing across different accounts, just like how water is flowing across different buckets.

Beancount.io introduces five kinds of accounts.

  1. Income — Its amount is always negative or in debit. This is because you are making money, and then the money is debiting from "Income" account and crediting to your "Assets."
  2. Expenses — Its amount is always positive or in credit. This is because you are spending money, and the money is flowing from the "Assets" or "Liabilities" to the "Expenses."
  3. Liabilities — Its amount is positive or zero. Your credit card liabilities are a good example, which rises and falls in cycles.
  4. Assets — Its amount is positive or zero. Your cash or houses are always worthing some prices.
  5. Equity — Your net assets. The system will calculate automatically for you. Equity = Assets - Liabilities and it reflects how wealthy you are.

Now you can open your customized accounts with those keywords above:

1970-01-01 open Assets:Cash
1970-01-01 open Assets:Stock:Robinhood
1970-01-01 open Assets:Crypto:Coinbase
1970-01-01 open Expenses:Transportation:Taxi
1970-01-01 open Equity:OpeningBalance

Commodities: Tracking your investment

Yes, you can track your investment with beancount.io. For example, we buy 10 Bitcoins at the price of $100 in 2014:

2014-08-08 * "Buy 10 Bitcoin"
Assets:Trade:Cash -1000.00 USD
Assets:Trade:Positions 10 BTC {100.00 USD}

And then three years later, you sell them (originally with costs of $100 per unit annotated with {100.00 USD}) at the price of $10,000 per unit annotated with @ 10,000.00 USD.

2017-12-12 * "Sell 2 Bitcoin"
Assets:Trade:Positions -2 BTC {100.00 USD} @ 10,000.00 USD
Assets:Trade:Cash 20,000.00 USD
Income:Trade:PnL -19,800.00 USD

Or the same transaction with @@ 20,000.00 USD means that at the price of $20,000 in total.

2017-12-12 * "Sell 2 Bitcoin"
Assets:Trade:Positions -2 BTC {100.00 USD} @@ 20,000.00 USD
Assets:Trade:Cash 20,000.00 USD
Income:Trade:PnL -19,800.00 USD

The sum of all legs of the transaction, including -2 BTC {100.00 USD}, are still, as always, zero.

The costs {100.00 USD} tag is important because you might have bought the same commodity at different costs.

100 BTC {10.00 USD, 2012-08-08}
10 BTC {100.00 USD, 2014-08-08}

If you want to simplify the process, you can set up the account at the beginning with FIFO or LIFO. FIFO stands for first in, first out, while LIFO stands for last in, first out. In the US, IRS uses FIFO to calculate your PnL and tax accordingly.

1970-01-01 open Assets:Trade:Positions "FIFO"

And then when you sell it in shorthand like -2 BTC {}, beancount will apply FIFO strategy automatically and sell the oldest commodity.

Beancount.io

Beancount.io is such a cloud service for recording your financial transactions in text files, visualize them into financial statements (income statement, balance sheet, trial balance, etc.), and helps you live a better financial life. Sign up now - It's in Promotional Period and Free!