The books never send invoices (A-4), but they must remember that one
went out: who sent it, how, to whom, when, whether it was the original
or a reminder, and the channel's own reference. That record is a fact
of the document's life, not a figure: a send moves no money, so it is
one journal line (`invoice.sent`) and no entry, and every derived
figure (outstanding, aging, DocState) is exactly as it was.
`Ledger::mark_sent` refuses a send on a void invoice (it should never
have reached the customer), a send dated before the invoice, no
recipients, and any recipient, reference or note that would put a full
TIN or control characters into the journal. Open, partial, paid and
written-off invoices can be sent (a copy for the customer's records, a
reminder).
The event is `documents_v2`'s (D-52): an older version refuses the
type rather than dropping the record. Replay restores it and the
projection keeps it in schema 16's `invoice_sends` table, so live,
replay and the viewer agree. The new old-books fixture `p4_s5_before`
was written by eeee9658 and opens to the same figures; a hand-written
send in `books_written_under_older_rules_still_open` proves an older
journal with the new line still opens.
Tests: mark_sent_waits_for_documents_v2, sends_replay_and_project,
a_send_changes_no_figure, mark_sent_on_void_refused, Op::MarkSent in
status_is_a_function_of_journal_and_date,
an_older_version_stops_at_invoice_sent.
34 lines
1.6 KiB
TOML
34 lines
1.6 KiB
TOML
# The harness that wrote tests/fixtures/old-books, through the Store API of
|
|
# the version that wrote them (main 188c90ea, 2026-10-17), and that version's
|
|
# expected.json (bin/expect). Not a workspace member: point the two paths at
|
|
# a checkout of the writing version (`git archive 188c90ea | tar -x -C
|
|
# wb-main`), then
|
|
# cargo run --bin writer -- OUT (the P0 review's thirteen and control)
|
|
# cargo run --bin extras -- OUT (the edges of chrono and Decimal)
|
|
# cargo run --bin extras2 -- OUT (depreciation for 10000-01; 1,044 drafts)
|
|
# cargo run --bin older -- OUT (x_older_rules, with its JournalWriter)
|
|
# cargo run --bin s5_before -- OUT (p4_s5_before: run against eeee9658,
|
|
# the revision before P4b S5)
|
|
# cargo run --bin p2_1099 -- OUT (p2_vendor_1099: P2's 1099 marks, run
|
|
# against 9c99a0cf, the revision before P3)
|
|
# cargo run --bin expect -- OUT (expected.json beside each journal)
|
|
# and copy each journal.jsonl, blobs/ and expected.json into old-books/.
|
|
# x_member_closes was written later, the same way, by main 00226a4c
|
|
# (2026-10-20, before P3's odd cent): `cargo run --bin members -- OUT`
|
|
# (members closes under every rounding rule main wrote; P3 review R-2).
|
|
[package]
|
|
name = "writer"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
[dependencies]
|
|
ledger-core = { path = "wb-main/crates/ledger-core" }
|
|
ledger-store = { path = "wb-main/crates/ledger-store" }
|
|
chrono = "=0.4.45"
|
|
rust_decimal = "=1.43.0"
|
|
serde_json = "1"
|
|
|
|
[workspace]
|
|
# main's crates (wb-main) keep their own workspace.
|
|
exclude = ["wb-main"]
|