FA-60144 / Inventory cost layering / Member archive
Invoice price variance on receipt layers: billed unit matching order · case 04
Price corrections are pushed into the on-hand layer while shipped units keep the old cost.
Case contract
Input {received, po_price, consumed, invoice_qty, invoice_price, tolerance}. Billed units = min(invoice_qty, received); total variance = billed*(invoice-po). If |total| <= tolerance the variance is written off and the layer is unchanged. Otherwise billed units are matched to consumed units first: consumed billed units adjust COGS, the rest revalue the on-hand layer. Return {layer_value, cogs_adj, writeoff, mismatch}.
Why this case matters
Inventory valuation and cost-of-goods decisions depend on this rule.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| under billed | {"cogs_adj": 0, "layer_value": 270, "mismatch": true, "writeoff": 0} | {"cogs_adj": 30, "layer_value": 240, "mismatch": true, "writeoff": 0} | 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 ↗