What does Multi-Entity Clearing and Audit-Ready Ledgers conclude, in numbers, about “Field Tools and Checker Specifications: the Month-End Ledger, the Four Kits and a Pre-Registered Test”?
Answer: Chapter 8 sets out field tools and checker specifications, the month-end ledger, a pre-registered test with its refutation condition, and the runnable Multi-Entity Clearing and Month-End Audit-Ready Reconciler. Boxes separate published evidence, runnable Python calculations (21 programs), early sources and hypotheses.
Scope of the numbers: The book is a handbook of accounting and compliance routines and is not personal tax advice. Parameters are illustrative, data synthetic, and all calculations come from the book's programs.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python only
| A. 603 ledger lines (600 + 3 booked again by SVC) | |
| R1 net booked, principal | 13 |
| R2 conversion slip missing | 20 |
| R3 shared cost, no written key | 8 |
| R4 same document, two entities | 6 |
| R5 binary float amount | 1 |
| Y1 gross booked, agent | 4 |
| Y2 evidence chain short | 73 |
| Y3 open over 5 days | 12 |
| B. lines red 47, yellow 75, green 481 | |
| C. green share 0.7977; every red line goes to the queue |
Show the full program
# Chapter 8. p81: red / yellow / green flags on a synthetic month-end
# ledger of 600 revenue lines carrying the loop fields (entity, channel,
# currency, gross, fee, net, role, booked basis, slip, evidence count,
# counterparty key, document id, amount text, match status, days open).
# Fault rates are illustrative; the rules are the ones of Chapter 8.
import random
import re
from collections import Counter
rng = random.Random(40281)
MONEY = re.compile(r"^-?\d+\.\d{2}$")
rows = []
for i in range(600):
ent = rng.choice(["SITE", "LIB", "AIX", "HX"])
role = "agent" if ent == "HX" or rng.random() < 0.15 else "principal"
basis = role if rng.random() > 0.04 else (
"agent" if role == "principal" else "principal")
cur = rng.choice(["MYR", "MYR", "USD", "TWD", "VND"])
slip = cur == "MYR" or rng.random() > 0.06
ev = 5 if rng.random() > 0.10 else rng.choice([3, 4, 4, 4])
ic = rng.random() < 0.08
key = (not ic) or rng.random() > 0.20
amt = "{:.2f}".format(rng.randint(500, 90000) / 100)
if rng.random() < 0.01:
amt = "{:.17g}".format(rng.randint(500, 90000) / 100)
status = "matched" if rng.random() > 0.05 else "open"
days = rng.randint(0, 12) if status == "open" else 0
rows.append(dict(doc="DOC{:04d}".format(i), ent=ent, role=role,
basis=basis, cur=cur, slip=slip, ev=ev, ic=ic,
key=key, amt=amt, status=status, days=days))
for j in rng.sample(range(600), 3): # booked again elsewhere
dup = dict(rows[j])
dup["ent"] = "SVC"
rows.append(dup)
if __name__ == "__main__":
seen = Counter((r["doc"]) for r in rows)
flags = Counter()
level = Counter()
for r in rows:
red, yellow = [], []
if r["role"] == "principal" and r["basis"] == "agent":
red.append("R1 net booked, principal")
if r["cur"] != "MYR" and not r["slip"]:
red.append("R2 conversion slip missing")
if r["ic"] and not r["key"]:
red.append("R3 shared cost, no written key")
if seen[r["doc"]] > 1:
red.append("R4 same document, two entities")
if not MONEY.match(r["amt"]):
red.append("R5 binary float amount")
if r["role"] == "agent" and r["basis"] == "principal":
yellow.append("Y1 gross booked, agent")
if r["ev"] < 5:
yellow.append("Y2 evidence chain short")
if r["status"] == "open" and r["days"] > 5:
yellow.append("Y3 open over 5 days")
for f in red + yellow:
flags[f] += 1
level["red" if red else ("yellow" if yellow else "green")] += 1
print("A. {} ledger lines (600 + 3 booked again by SVC)".format(
len(rows)))
for k in sorted(flags):
print(" {:<34} {:>4}".format(k, flags[k]))
print("B. lines red {}, yellow {}, green {}".format(
level["red"], level["yellow"], level["green"]))
print("C. green share {:.4f}; every red line goes to the queue".format(
level["green"] / len(rows)))Single source and citation
Fan, Y. (2026). Multi-Jurisdiction Digital Revenue Clearing, Cross-Border Tax-Base Compliance Boundaries and Audit-Ready Automated Ledgers (Version 1.0.0), Chapter 8: Field Tools and Checker Specifications: the Month-End Ledger, the Four Kits and a Pre-Registered Test. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-402 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026402,
author = {Fan, Yafu},
title = {Multi-Jurisdiction Digital Revenue Clearing, Cross-Border Tax-Base Compliance Boundaries and Audit-Ready Automated Ledgers},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · Gross or Net: Judging the Principal by Control, Not by How the Platform Pays
- Chapter 2 · When the Currency Turns: Transaction-Date Rates, Closing-Rate Remeasurement and Decimal Rounding
- Chapter 3 · Clearing Among Entities: Bilateral and Multilateral Netting and Open Balances
- Chapter 4 · Shared Costs Between Related Entities: the Arm's Length Principle, Allocation Keys and Contemporaneous Documentation
- Chapter 5 · Four-Way Reconciliation: Auto-Match Rate, Tolerance and Cross-Entity Duplicates
- Chapter 6 · Evidence Chains, First-Digit Leads and Month-End Close Time
- Chapter 7 · Four Pillars and Double Entry: the Ming Registers and Pacioli's Ledger Examined