From 3ea008bb543f7854282bb0aa7e67607ffe8ceed3 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Tue, 27 Oct 2026 08:50:25 -0600 Subject: [PATCH] feat(viewer): the journal says an invoice went out (P4b S5) R-B item 7: every journal event gets a plain-language sentence, so the new `invoice.sent` reads "Invoice 7 sent by email" (or "reminder") instead of showing its event name. A send has no entry to open, so the line has no route: it is a document event, not a posting. --- crates/ledger-gui/src/pages/journal.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/ledger-gui/src/pages/journal.rs b/crates/ledger-gui/src/pages/journal.rs index 67654c5..7c7f123 100644 --- a/crates/ledger-gui/src/pages/journal.rs +++ b/crates/ledger-gui/src/pages/journal.rs @@ -807,6 +807,24 @@ pub fn describe(b: &Books, line: &JournalLine) -> Option { format!("Payment received, {}", amount(p)), entry_id.map(Route::Entry), ), + "invoice.sent" => { + let invoice = p.get("invoice_id").and_then(|v| v.as_u64()).unwrap_or(0); + let via = p + .get("via") + .and_then(|v| v.as_str()) + .map(|v| v.strip_prefix("other:").unwrap_or(v)) + .unwrap_or("a channel"); + let what = if p.get("kind").and_then(|v| v.as_str()) == Some("reminder") { + "reminder " + } else { + "" + }; + ev( + icon::INVOICE, + format!("Invoice {invoice} {what}sent by {via}"), + None, + ) + } "bill.paid" => ev( icon::MONEY, format!("Bill paid, {}", amount(p)),