feat(viewer): Invoices & Bills, a document's page, overview tiles (P4b S2)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
One sidebar item, Invoices & Bills (the owner's choice, 2026-10-24), with Money in (invoices) and Money out (bills) tabs: what is owed and overdue, and the list tied to its receivables or payables account (Agrees, or what to look at); filters Open, Overdue, Paid, Void, All; rows by due date, an overdue one saying how many days late, each named in full for assistive tech. A document's page: total, received or paid, still owed, status; its lines with their projects; its timeline, a payment later reversed marked so, each row opening its entry. The overview adds Owed to you and You owe on bills once the books have documents. Every figure is the document's derived state (rules.md B-38). The sidebar's rows (and the rail's) give way to 22 points, not 24, so 13 links still fit the owner's 1479x519 window unscrolled; the sidebar's tests compute heights from the link count; the 1440x920 golden is re-blessed for the new link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
This commit is contained in:
11 files changed
+927
-13
No files matched your search
@@ -148,7 +148,7 @@ fn kpis(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) {
|
||||
),
|
||||
};
|
||||
let ytd = b.fiscal_ytd();
|
||||
let tiles: Vec<(Kpi, Route)> = vec![
|
||||
let mut tiles: Vec<(Kpi, Route)> = vec![
|
||||
(
|
||||
Kpi {
|
||||
label: "Cash on hand",
|
||||
@@ -222,6 +222,42 @@ fn kpis(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) {
|
||||
Route::Cash,
|
||||
),
|
||||
];
|
||||
// Invoices and bills, once the books have any (P4b S2).
|
||||
if let Some((owed, late, _)) = super::invoices::summary(b, false) {
|
||||
tiles.push((
|
||||
Kpi {
|
||||
label: "Owed to you",
|
||||
value: fmt::dollars(owed),
|
||||
sub: Some(if late > 0 {
|
||||
(
|
||||
fmt::count(late, "invoice overdue", "invoices overdue"),
|
||||
p.warning,
|
||||
)
|
||||
} else {
|
||||
("none overdue".into(), p.muted)
|
||||
}),
|
||||
spark: None,
|
||||
how: "What customers' open invoices still owe, read from the ledger.",
|
||||
},
|
||||
Route::Receivables,
|
||||
));
|
||||
}
|
||||
if let Some((owed, late, soon)) = super::invoices::summary(b, true) {
|
||||
tiles.push((
|
||||
Kpi {
|
||||
label: "You owe on bills",
|
||||
value: fmt::dollars(owed),
|
||||
sub: Some(if late > 0 {
|
||||
(fmt::count(late, "bill overdue", "bills overdue"), p.warning)
|
||||
} else {
|
||||
(format!("{} due this week", soon), p.muted)
|
||||
}),
|
||||
spark: None,
|
||||
how: "What vendors' open bills still owe, read from the ledger.",
|
||||
},
|
||||
Route::Payables,
|
||||
));
|
||||
}
|
||||
super::grid(ui, tiles.len(), 150.0, 6, |i, ui| {
|
||||
let (tile, route) = &tiles[i];
|
||||
let r = widgets::kpi(
|
||||
|
||||
Reference in new issue
Block a user