feat(gui): the journal says a write-off in plain words (P4b S7)
R-B: a new event type gets a describe arm, so the journal's list reads "Invoice 7 written off, 60.00" and opens the entry, rather than printing the type at a human. every_journal_event_has_plain_language_text scans store.rs for the types and fails on any without text.
This commit is contained in:
1 parent
d74ee1e962
commit
4b4fecb98e
1 file changed
+8
@@ -812,6 +812,14 @@ pub fn describe(b: &Books, line: &JournalLine) -> Option<Event> {
|
|||||||
format!("Bill paid, {}", amount(p)),
|
format!("Bill paid, {}", amount(p)),
|
||||||
entry_id.map(Route::Entry),
|
entry_id.map(Route::Entry),
|
||||||
),
|
),
|
||||||
|
"invoice.written_off" => {
|
||||||
|
let invoice = p.get("invoice_id").and_then(|v| v.as_u64()).unwrap_or(id);
|
||||||
|
ev(
|
||||||
|
icon::HAND_COINS,
|
||||||
|
format!("Invoice {invoice} written off, {}", amount(p)),
|
||||||
|
entry_id.map(Route::Entry),
|
||||||
|
)
|
||||||
|
}
|
||||||
"period.created" => ev(
|
"period.created" => ev(
|
||||||
icon::CALENDAR_PLUS,
|
icon::CALENDAR_PLUS,
|
||||||
format!("Period {} created", s(p, "name")),
|
format!("Period {} created", s(p, "name")),
|
||||||
|
|||||||
Reference in new issue
Block a user