Ledger tables
The shapes an accounting table takes that a generic one does not: a running balance, grouped rows with subtotals, and a debit-credit pair that has to add up.
A running balance
every row carries the balance after it
| Date | Detail | In | Out | Balance |
|---|---|---|---|---|
| 01 Sep | Opening balance | 212,400.00 | ||
| 03 Sep | Payment · Delta Fabrication | 9,375.00 | 221,775.00 | |
| 05 Sep | Salaries, September | 17,900.00 | 203,875.00 | |
| 09 Sep | Payment · Northwind Trading | 11,480.00 | 215,355.00 | |
| 14 Sep | Rent, quarter to December | 24,000.00 | 191,355.00 | |
| 18 Sep | Payment · Ferrow Manufacturing | 9,000.00 | 200,355.00 | |
| 22 Sep | Software subscriptions | 2,450.00 | 197,905.00 | |
| Closing balance, 30 September | 29,855.00 | 44,350.00 | 197,905.00 | |
212,400.00 + 29,855.00 − 44,350.00 = 197,905.00. The opening row is marked data-static so sorting the table never moves it out of first place.
Grouped, with subtotals
how a profit and loss reads
| Account | This year | Budget | Variance |
|---|---|---|---|
| People | |||
| 6000 · Salaries & wages | $214,800.00 | $189,000.00 | −$25,800.00 |
| People subtotal | $214,800.00 | $189,000.00 | −$25,800.00 |
| Premises | |||
| 6100 · Rent & utilities | $96,000.00 | $99,360.00 | $3,360.00 |
| Premises subtotal | $96,000.00 | $99,360.00 | $3,360.00 |
| Running costs | |||
| 6200 · Software subscriptions | $29,400.00 | $23,328.00 | −$6,072.00 |
| 6300 · Professional fees | $45,000.00 | $34,706.88 | −$10,293.12 |
| 6400 · Depreciation | $23,400.00 | $23,328.00 | −$72.00 |
| Running costs subtotal | $97,800.00 | $81,362.88 | −$16,437.12 |
| Total operating expenses | $408,600.00 | $369,722.88 | −$38,877.12 |
These are the figures build/books.mjs generates, not numbers typed into a template — the subtotals add to the total because they are the same numbers the Budgets screen and the profit and loss are built from.
Debit and credit
the one table that must balance
| Account | Detail | Debit | Credit |
|---|---|---|---|
| 1100 · Accounts receivable | Invoice INV-0245 | 4,546.50 | |
| 4000 · Sales | Bookkeeping, September | 2,400.00 | |
| 4100 · Services | Quarter-end review | 1,800.00 | |
| 2100 · Tax payable | Tax at 8.25% | 346.50 | |
| Balanced | 4,546.50 | 4,546.50 | |
2,400.00 + 1,800.00 + 346.50 = 4,546.50. A journal that does not balance is not a display problem — it is a broken ledger, which is why the build asserts it rather than trusting it.