FA-58317 / Double-entry ledger accounting / Member archive
Straight-line depreciation journal: mid-month half steps · case 02
Mid-month assets take twice the useful life to depreciate.
Case contract
x = {'cost', 'salvage', 'life_months', 'start_month', 'convention': 'full_month'|'mid_month'|'next_month', 'through': last month to post}. Depreciable base = cost - salvage. The first charge month is start_month (start_month + 1 for next_month). Charges use cumulative rounding: target accumulated after the j-th charge month is round(base*j/life) or, for mid_month, round(base*(2j-1)/(2*life)), half-up and capped at base; each month posts target - accumulated. Posting stops after 'through' or once accumulated reaches base. Return {'schedule': [[month, amount]], 'accumulated', 'book_value': cost - accumulated}.
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: mid-month half steps | {"accumulated": 87999, "book_value": 12000, "schedule": [[10, 3667], [11, 3666], [12, 3667], [13, 3667], [14, 3666], [15, 3667], [16, 3666], [17, 3667], [18, 3667], [19, 3666], [20, 3667], [21, 3667], [22, 3666], [23, 3667], [24, 3666], [25, 3667], [26, 3667], [27, 3666], [28, 3667], [29, 3667], [30, 3666], [31, 3667], [32, 3666], [33, 3667]]} | {"accumulated": 87999, "book_value": 12000, "schedule": [[10, 3667], [11, 7333], [12, 7333], [13, 7333], [14, 7334], [15, 7333], [16, 7333], [17, 7333], [18, 7334], [19, 7333], [20, 7333], [21, 7333], [22, 3667]]} | 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 ↗