FAILURE MAP
← Case archive

FA-58234 / Double-entry ledger accounting / Member archive

Intercompany elimination: eliminated amount · case 04

Consolidation shows negative intercompany payables.

Member previewVariant 4 · 3 implementations · 7 checks per implementation

Case contract

x = [[entity, account, counterparty or None, amount]]. Rows with no counterparty, the entity itself as counterparty, or an account outside the pairs (ic_receivable/ic_payable, ic_sales/ic_purchases) are consolidated as-is. For each (entity, counterparty, pair) the left balance of entity toward counterparty is matched against the right balance of counterparty toward entity; min(left, right) is eliminated from both, residuals are consolidated and a mismatch [entity, counterparty, left account, left - right] is reported when they differ. Return {'consolidated': nonzero account totals, 'mismatches': in sorted key order}.

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: eliminated amount{"consolidated": {"cash": -400, "ic_loan": 1000, "ic_payable": 100, "ic_purchases": 1000, "ic_receivable": 100, "ic_sales": 100}, "mismatches": [["P", "S1", "ic_sales", -100], ["P", "S2", "ic_sales", -1000], ["S2", "P", "ic_sales", 100]]}{"consolidated": {"cash": -400, "ic_loan": 1000, "ic_payable": 100, "ic_purchases": 1100, "ic_receivable": 100, "ic_sales": 200}, "mismatches": [["P", "S1", "ic_sales", -100], ["P", "S2", "ic_sales", -1000], ["S2", "P", "ic_sales", 100]]}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 ↗