Add payments with TDS, invoice detail view and filterable History (Phase E2)

- Migration M8 adds payments (cash, TDS, mode, reference). Payment status is derived, never stored: unpaid, partially paid, paid, or overdue. Overpayment is rejected, TDS counts toward settling, and only issued invoices accept payments. list_invoices and get_invoice carry the paid, TDS and balance summary.
- New invoice detail view: archived-PDF preview, payments list, Record payment modal, Export, Duplicate (as a draft), Re-render and Cancel. An invoice with payments cannot be cancelled until they are deleted.
- History gets search, status, financial-year, month and client filters, sortable columns, pagination, footer totals and an FY summary. Cancelled invoices are excluded from totals. The per-row archive-status calls are gone; archiving is on the detail page.
- Rust tests for payments and the list summary; vitest for fiscal-year, money, filter and duplicate helpers.

PDF output and fingerprint goldens are unchanged. The new UI has not been run in a webview yet.
This commit is contained in:
2026-10-04 17:49:25 +05:30
parent 708fa7b610
commit 9fdff4f263
25 changed files with 2220 additions and 175 deletions
+130
View File
@@ -540,3 +540,133 @@ body {
margin-top: 0.5rem;
font-size: 0.75rem;
}
/* ---------- Invoice history and detail ---------- */
.voiced-num {
text-align: right;
}
.voiced-history__fy {
font-size: 1.25rem;
font-weight: 400;
margin-bottom: 0.5rem;
}
.voiced-history__tiles,
.voiced-detail__tiles {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
gap: 1rem;
margin-bottom: 1.5rem;
}
.voiced-history__amount,
.voiced-detail__amount {
font-size: 1.75rem;
font-weight: 400;
}
.voiced-history__tile--overdue {
border-left: 4px solid var(--cds-support-error);
}
.voiced-history__filters {
display: grid;
grid-template-columns: minmax(14rem, 2fr) repeat(4, minmax(9rem, 1fr)) auto;
gap: 1rem;
align-items: end;
margin-bottom: 1rem;
}
.voiced-history__row {
cursor: pointer;
}
.voiced-history__totals {
display: flex;
flex-wrap: wrap;
gap: 0.5rem 2rem;
padding: 0.75rem 1rem;
background: var(--cds-layer-accent);
border-top: 1px solid var(--cds-border-subtle);
}
.voiced-detail__head {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.75rem;
margin-top: 1rem;
}
.voiced-detail__actions {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.5rem;
margin: 1rem 0;
}
.voiced-detail__grid {
display: grid;
grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
gap: 2rem;
align-items: start;
}
@media (max-width: 1100px) {
.voiced-detail__grid,
.voiced-history__filters {
grid-template-columns: 1fr;
}
}
.voiced-detail__h2 {
font-size: 1.25rem;
font-weight: 400;
margin-bottom: 0.75rem;
}
.voiced-detail__parties {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
}
.voiced-detail__field {
margin-bottom: 0.75rem;
}
.voiced-detail__pre {
white-space: pre-line;
}
.voiced-detail__totals {
margin: 1rem 0 0.5rem auto;
max-width: 22rem;
}
.voiced-detail__totals > div {
display: flex;
justify-content: space-between;
padding: 0.25rem 0;
}
.voiced-detail__grand {
border-top: 1px solid var(--cds-border-strong);
font-weight: 600;
}
.voiced-detail__preview {
position: sticky;
top: 4rem;
}
.voiced-detail__unarchived {
padding: 1.5rem;
background: var(--cds-layer-accent);
}
.voiced-detail__unarchived p {
margin-bottom: 1rem;
}