FA-57933 / Double-entry ledger accounting / Member archive
Period closing entries: temporary account list · case 03
The dividend account is left open after closing.
Case contract
x = {'accounts': {name: [type, normal-signed balance]}, 'retained': opening retained earnings, 'aoci': opening accumulated OCI}. Temporary types are revenue, contra_revenue, expense, gain, loss, dividend and oci. Income summary = revenue - contra_revenue + gain - expense - loss and is net income. Retained earnings close = opening + net income - dividends. OCI closes to AOCI, never to income or retained earnings. 'closed' lists temporary accounts with a nonzero balance (including abnormal negative ones), sorted. Return {'net_income', 'retained', 'aoci', 'closed'}.
Why this case matters
Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: temporary account list | {"aoci": 300, "closed": ["gain_3", "reve_0"], "net_income": 200, "retained": -200} | {"aoci": 300, "closed": ["divi_5", "gain_3", "reve_0"], "net_income": 200, "retained": -200} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗