FA-58337 / Double-entry ledger accounting / Member archive
Straight-line depreciation journal: through month inclusivity · case 02
The depreciation run omits the charge for the month it is run through.
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: through month inclusivity | {"accumulated": 59399, "book_value": 40600, "schedule": [[4, 1650], [5, 1650], [6, 1650], [7, 1650], [8, 1650], [9, 1650], [10, 1650], [11, 1650], [12, 1650], [13, 1650], [14, 1650], [15, 1650], [16, 1650], [17, 1650], [18, 1650], [19, 1650], [20, 1650], [21, 1650], [22, 1650], [23, 1650], [24, 1650], [25, 1650], [26, 1650], [27, 1650], [28, 1650], [29, 1650], [30, 1650], [31, 1650], [32, 1650], [33, 1650], [34, 1649], [35, 1650], [36, 1650], [37, 1650], [38, 1650], [39, 1650]]} | {"accumulated": 61049, "book_value": 38950, "schedule": [[4, 1650], [5, 1650], [6, 1650], [7, 1650], [8, 1650], [9, 1650], [10, 1650], [11, 1650], [12, 1650], [13, 1650], [14, 1650], [15, 1650], [16, 1650], [17, 1650], [18, 1650], [19, 1650], [20, 1650], [21, 1650], [22, 1650], [23, 1650], [24, 1650], [25, 1650], [26, 1650], [27, 1650], [28, 1650], [29, 1650], [30, 1650], [31, 1650], [32, 1650], [33, 1650], [34, 1649], [35, 1650], [36, 1650], [37, 1650], [38, 1650], [39, 1650], [40, 1650]]} | 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 ↗