Sub topic 8
Writing balanced journal entries
This chapter assumes you know the accounting equation, the five account types, and which side (debit or credit) increases each type. A journal entry is the written record of one transaction. It lists the accounts affected, the side of each, and the amounts.
The shape of an entry
Every entry has a date, one or more debit lines, one or more credit lines, and a short description. By convention, debit lines come first, and credit lines are indented below them. The total debits must equal the total credits. If they don't, the entry is invalid.
Every transaction has two sides, so every entry touches at least two accounts. Some entries touch more. These are called compound entries, and they are still valid if the totals match.
A four-step method
- Identify the accounts affected.
- Classify each account as an asset, liability, equity, revenue or expense.
- Decide whether each account goes up or down, then pick the side from its type.
- Check that total debits equal total credits.
Worked example
The owner invests $1,000 cash. Then the business earns $500 of service revenue in cash. Then it pays $300 rent in cash.
1) Dr Cash 1,000
Cr Owner Capital 1,000
2) Dr Cash 500
Cr Service Revenue 500
3) Dr Rent Expense 300
Cr Cash 300Here is the reasoning for each entry:
- Entry 1: Cash is an asset and it rises, so it is debited. Owner Capital is equity and it rises, so it is credited.
- Entry 2: Cash rises again, so it is debited. Revenue rises, so it is credited.
- Entry 3: Rent Expense is an expense and it rises, so it is debited. Cash is an asset and it falls, so it is credited.
Cash appears on both sides across the three entries. That is normal. The side depends on the direction of change, not on the account's name.
A compound entry
Suppose you buy equipment for $2,000. You pay $500 in cash and borrow the rest.
Dr Equipment 2,000
Cr Cash 500
Cr Notes Payable 1,500There is one debit and two credits. The debit of 2,000 equals the credits of 500 + 1,500, so the entry balances.
Checking balance in code
A program can enforce the rule before it accepts an entry. Use Decimal for money, because floats introduce rounding errors.
from decimal import Decimal
def is_balanced(lines):
debits = sum(a for _, side, a in lines if side == "debit")
credits = sum(a for _, side, a in lines if side == "credit")
return debits == credits
entry = [
("Equipment", "debit", Decimal("2000.00")),
("Cash", "credit", Decimal("500.00")),
("Notes Payable", "credit", Decimal("1500.00")),
]
print(is_balanced(entry)) # TrueCommon errors
| Error | Why it fails |
|---|---|
| Debiting and crediting the same side twice | Totals differ, so the entry is unbalanced |
| Choosing the side by "good" or "bad" | A debit is not a gain, and a credit is not a loss. Use the account type |
| Crediting an expense because you "paid" | Paying reduces Cash, which is credited. The expense is debited |
| Leaving out a line in a compound entry | The totals will not match |
Exercise
A customer pays you $800 cash for services performed today. Write the journal entry and say which account types are involved.
Show answer
Dr Cash 800; Cr Service Revenue 800. Cash is an asset and increases, so it is debited. Service Revenue is revenue and increases, so it is credited. Total debits of 800 equal total credits of 800.
Exercise
You buy $400 of supplies. You pay $150 in cash and the remaining $250 goes on account (you owe the supplier). Write the entry.
Show answer
Dr Supplies 400; Cr Cash 150; Cr Accounts Payable 250. Supplies is an asset that increases (debit). Cash is an asset that decreases (credit). Accounts Payable is a liability that increases (credit). Debits of 400 equal credits of 150 + 250.