From 6b9b5fe5182b80e7c0de845224678f9b3e092390 Mon Sep 17 00:00:00 2001 From: siddharthd Date: Wed, 12 Aug 2026 20:12:36 +1000 Subject: [PATCH] orders: badge the annual summary receipts (board 211) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migration 033 adds entity_orders.summarises_period; order_spend drops those rows and order_feed keeps them. Unbadged, a $2,376 annual tax receipt restating twelve monthly donations renders as the largest single purchase of the year, so both surfaces say what it is: - /orders — a "year summary" chip beside the auth badges - /orders/ — a banner in the same shape as the settled-rail one, saying the monthly debits are in the ledger under their own dates The amount is deliberately still shown. It is the year's giving total and the reason the row is worth keeping; it just belongs to no total on the page. The detail page already falls back to o.order_total when order_spend has no row, which is exactly the case now — verified: gross_total null, order_total 2125.5. --- src/app/orders/[entityKey]/page.tsx | 17 +++++++++++++++++ src/app/orders/page.tsx | 11 +++++++++++ src/lib/order-feed.ts | 12 +++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/app/orders/[entityKey]/page.tsx b/src/app/orders/[entityKey]/page.tsx index dd9849e..a1c7b69 100644 --- a/src/app/orders/[entityKey]/page.tsx +++ b/src/app/orders/[entityKey]/page.tsx @@ -94,6 +94,23 @@ export default function OrderDetailPage({ params }: { params: Promise<{ entityKe {/* A settled rail row must never look like an ordinary order — that is how a human counts the same purchase twice. */} + {/* Board 211 — same shape as the settled-rail banner above: a real + document with a real figure that is not a purchase. Saying which + payments it restates is the point; the total alone reads as a + single large order. */} + {o.summarises_period && ( +
+ + Annual summary, not a purchase + + + This receipt restates payments already made across the year — the + monthly debits are in the ledger under their own dates. It is kept + for reference and excluded from spend totals. + +
+ )} + {o.is_settled_duplicate && (
diff --git a/src/app/orders/page.tsx b/src/app/orders/page.tsx index b1d54c9..9d8a7fa 100644 --- a/src/app/orders/page.tsx +++ b/src/app/orders/page.tsx @@ -315,6 +315,17 @@ function Row({ row, expanded, onToggle }: { row: OrderRow; expanded: boolean; on {row.auth_verdict === "partial" ? "part. auth" : `auth ${row.auth_verdict}`} )} + {/* Board 211. A $2,376 annual tax receipt restating twelve monthly + donations is not a purchase, and unbadged it reads as the largest + order of the year. It stays on the page because the figure is the + year's giving total — but it is excluded from spend, so the + number beside it belongs to no total here. */} + {row.summarises_period && ( + year summary + )} {row.injection_flagged && ( 'line_items', '[]'::jsonb) AS line_items, sp.order_total AS net_total, sp.gross_total,