fairroom-direct-bill
v0.1.0
Published
Fairroom Direct Bill: ages direct bill (city ledger) receivables by account, flags accounts over their credit limit or with no direct bill agreement and unapplied credits, and drafts a statement for one account; a person sends it.
Maintainers
Readme
Fairroom Direct Bill (fairroom-direct-bill)
Ages your direct bill (city ledger) receivables by account: current, 1 to 30, 31 to 60, 61 to 90 and over 90 days past due, counted from the invoice date plus each account's terms. It flags accounts over their credit limit, accounts billed without a direct bill agreement and unapplied credits, and drafts a statement for one account; a person sends it.
MIT · Node 20 or newer · local files only · built on fairroom-core
npx -y fairroom-direct-bill demo
npx -y fairroom-direct-bill mcp --root ./city-ledgerWhat it finds
| Finding | Action |
|---|---|
| over_90: an invoice more than 90 days past due | Collect first |
| past_due: an invoice 1 to 90 days past due | Collect |
| credit_balance: a negative balance (unapplied payment or refund owed) | Apply or refund, a person decides |
| over_limit: the account owes more than its credit limit | Review before more direct billing |
| no_agreement: open items on an account the settings file does not list | Review |
Settings file (optional)
terms_days (default 30), accounts by name with terms_days, credit_limit and contact, confirmed_by, confirmed_on. no_agreement is only checked when accounts are listed.
A demo run
npx -y fairroom-direct-bill demo runs the agent on the fictional files in fixtures/ in a temporary folder. Captured output:
Fairroom Direct Bill demo (fictional city ledger, as of 18 Nov 2026), Auto mode on for the draft only
▶ Audit the fictional files
status: executed decision: allow
3 direct bill account(s) as of 2026-11-18: 5810 open, 3530 past due (950 over 90 days), -120 in credits to apply.
Bluefin Events balance 3000 past due 600 over 90 0 collect
Harbor Crew Lines balance 780 past due 780 over 90 0 collect
Northwind Travel balance 2030 past due 2150 over 90 950 collect_now
▶ Explain Northwind Travel
status: executed decision: allow
Northwind Travel: 2030 open (2150 past due, oldest 111 days), terms 15 days, collect_now. Invoice CL-470 shows a credit of -120: an unapplied payment or a refund owed. Invoice CL-488 (2026-08-01) is 94 days past due: 950. Invoice CL-501 (2026-10-20) is 14 days past due: 1200.
▶ Write the worklist (CSV and HTML)
status: executed decision: allow
Direct bill receivables aging written: 3 direct bill account(s) as of 2026-11-18: 5810 open, 3530 past due (950 over 90 days), -120 in credits to apply.
▶ Write the draft (statement)
status: executed decision: allow (auto)
statement Northwind Travel drafted for 2030 with 0 open marker(s). Nothing was sent.
▶ Auto: approving it stays one named click
status: needs_approval decision: ask
reason: binding_send stays one-click, even in Auto
▶ The agent tries guest_message_send itself
status: blocked decision: block
reason: Fairroom never e-mails, texts or messages a guest.Tools
| Tool | What it does | Policy |
|---|---|---|
| direct_bill_check | Age every open item by days past due and roll up by account. | runs |
| direct_bill_explain | Show one account: every open invoice with its due date and days past due, and every finding. | runs |
| direct_bill_write_report | Write direct-bill-aging.csv and direct-bill-aging.html (one row per item, with a blank decision column for the person working it) into out_dir (default fairroom-out/direct-bill). | runs |
| direct_bill_draft_statement | Write drafts/statement-.md: every open invoice with due date and days past due, and the balance. | asks first (Auto can be opted in) |
| direct_bill_request_send | After one named human click (even in Auto), record that the reviewed statement draft is approved in statement-requests.csv. | one named click, even in Auto (binding_send) |
| guest_message_send | Fairroom never e-mails, texts or messages a guest. | refused |
| ar_write_off_balance | Fairroom Direct Bill never writes off or adjusts a receivable; the controller does. | refused |
| collections_email_send | Fairroom Direct Bill never e-mails an account; a person sends the statement. | refused |
Any tool name not in this table is blocked, including names a model invents. refused tools are listed so a model can see they exist and are refused.
Columns it reads
Table inputs can be CSV, TSV, semicolon- or pipe-separated text, Excel .xlsx, JSON or JSONL. Columns are matched by the agent's own name, then by the English names below, then by their names in German, French, Spanish, Portuguese, Italian, Japanese, Chinese and Korean. Dates become YYYY-MM-DD; amounts are read with either decimal mark. Guest names, e-mails, phones and loyalty numbers are masked in what the AI model sees, and card numbers are cut to the last four digits. Every result lists under sources how each file was read.
Direct bill open items (ledger)
| Column | Type | Also read as | For example, in other languages |
|---|---|---|---|
| account (required) | text | Account, Account Name, Company, Direct Bill Account, AR Account, Customer | Konto, Compte, 勘定科目, 科目代码 |
| invoice (required) | text | Invoice, Invoice Number, Invoice No, Folio, Document | Rechnungsnummer, N° de facture, 請求書番号, 发票号 |
| invoice_date (required) | date | Invoice Date, Date, Posted, Transfer Date | Rechnungsdatum, Date de facture, 請求日, 发票日期 |
| amount | amount | Amount, Original Amount, Invoice Amount, Total | Betrag, Montant, 金額, 金额 |
| balance (required) | amount | Balance, Open Balance, Outstanding, Amount Due, Open Amount | Saldo, Solde, 残高, 余额 |
| reservation | text | Reservation, Confirmation Number, Reservation Number | Reservierungsnummer, N° de réservation, 予約番号, 预订号 |
Files from other countries
A German export in Windows-1252 with semicolons, 1.234,56 and 03.11.2026, or a Japanese one in Shift_JIS with 2026/11/03, is read the same way as the English file. fixtures/intl/ has both versions of the demo data, and the eval cases intl-de-* and intl-ja-* require the same results as the English case. Amounts are read with either decimal mark; currencies are not converted. Columns named differently? Run npx fairroom-direct-bill inspect <file> (names and shapes only, never values) and name them in fairroom-sources.json:
{ "files": { "exports/journal.csv": { "columns": { "reservation": "Buchungsnr" }, "date_order": "dmy" } } }Install
Node 20 or newer. No other dependencies.
npx -y fairroom-direct-bill demo
npx -y fairroom-direct-bill mcp --root /path/to/your/filesClaude Desktop, Cursor and other MCP hosts:
{
"mcpServers": {
"fairroom-direct-bill": {
"command": "npx",
"args": [
"-y",
"fairroom-direct-bill",
"mcp",
"--root",
"/path/to/your/files"
]
}
}
}Claude Code: claude mcp add fairroom-direct-bill -- npx -y fairroom-direct-bill mcp --root ., or install the fairroom-direct-bill plugin from this repository's marketplace.
Modes and approvals
- Review (
--mode review): reads and reports only. - Assist (default): the policy above. A tool that asks returns an
approval_id; a person approves it once withfairroom-direct-bill approve <id> --as "Your Name"(or on the local approvals page,fairroom-direct-bill approvals), and the same call is repeated. - Auto (
--mode auto --auto <tool,...>): opt-in per tool, with step caps and a kill switch (fairroom-direct-bill kill). Paying, sending, posting to a ledger or a live system and accepting a learned fact stay one named click even in Auto; an approval is tied to the sha256 of the reviewed draft, so a changed draft needs a new click.
CLI
fairroom-direct-bill tools # every tool, its policy and arguments
fairroom-direct-bill sources # the columns each input is read from
fairroom-direct-bill inspect <file> # how a file would be read (names and shapes, never values)
fairroom-direct-bill call direct_bill_check '{"ledger":"<ledger>"}'
fairroom-direct-bill eval # the private eval cases on the fictional fixtures
fairroom-direct-bill demoAudit log and data
Every call is written to .fairroom/audit.jsonl under the root: hash-chained JSON lines, with arguments stored as a hash, signed with an Ed25519 key when you configure one. Everything runs on your machine on files you choose. No network calls, no telemetry, no credentials. The bundled fixtures are fictional.
Limits
- Reads only the files you give it. It does not log in to the PMS or accounting system.
- It never sends a statement or a collection message and never writes off a balance.
