# Fictional credit-adjustment ledger

Anant Mishra · 24 November 2026 · Prepared with AI assistance.

Save fixture.json and reproduce.py together and run `python3 reproduce.py > new-record.json`. Compare results, boundary_checks and sha256 with execution-record.json. UTC time and Python version describe the actual run and may differ. Standard library only; no network, credentials, ERP or provider calls.

One fictional AED invoice has 100,000 minor units, with 100 minor units per major unit assumed. Eight ordered receipts include partial credits, identical replay and unsupported allocation cases. Two declared scenarios verify expected states and final 75,000 allocated / 25,000 remaining units. The second adds two identical replays. Seventeen named boundary checks exercise malformed fields, exact capacity, excess, changed content, referenced volume entries and canonical key order.

This is a local control policy, not a PINT-AE rule implementation. The cap is an assumed ceiling for positive gross allocations, not an amount due or tax determination. Ordinary/volume are local categories, not official code lists. New unreferenced volume entries go to period review, not automatic rejection or approval. First-seen content is retained for all statuses; identical later content is a receipt replay, changed content a conflict. Held entries cannot be revised under the same identity in this toy. A real correction/approval workflow must be designed separately. Conflicts do not erase earlier allocations, which remain subject to review.

Order is authoritative only within the authored scenario. Reordering competing credits can change which one fits first. No concurrency, persistence, recovery, multi-invoice allocation, negative lines, tax breakdowns, currency conversion, payment/refund reconciliation or approval authority is modeled. No UBL or full rules validation ran. No provider acceptance, compliance, deployment, savings, client outcome, DGX experiment or scholarly release is claimed.

Primary-source review: OpenPeppol PINT-AE v1.0.5 billing guide section 1.5.4, credit-note BillingReference binding and reason-code definition, checked 24 November 2026. These distinguish national credit-note processing from generic negative-invoice discussion and supply context for references/reasons. They do not prescribe this internal ledger policy. Next evidence: authorized redacted source records, verified document identity, finance-approved allocation policy, applicable provider/version contract, concurrent database tests and posting reconciliation.
