FA-60153 / Inventory cost layering / Member archive
Invoice price variance on receipt layers: tolerance measure · case 03
Large invoices with a tiny per-unit difference are written off wholesale.
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 |
|---|---|---|---|
| price up partly consumed | {"cogs_adj": 0, "layer_value": 600, "mismatch": false, "writeoff": 130} | {"cogs_adj": 52, "layer_value": 678, "mismatch": false, "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 ↗