Moved case title above charges
X-Lovable-Edit-ID: edt-4b1cc118-4b3b-49ce-bde1-775273b2a163 Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
@@ -56,6 +56,7 @@ export interface InvoicePdfInput {
|
||||
status: string;
|
||||
notes?: string | null;
|
||||
matter?: string | null;
|
||||
caseNumber?: string | null;
|
||||
terms?: string | null;
|
||||
};
|
||||
groups: InvoiceCaseGroup[];
|
||||
@@ -275,11 +276,12 @@ export async function downloadInvoicePdf(input: InvoicePdfInput, filename: strin
|
||||
ty += 11;
|
||||
}
|
||||
|
||||
// Info card (right) — key/value rows
|
||||
// Info card (right) — key/value rows.
|
||||
// "Case No." is shown directly under the invoice number for quick reference.
|
||||
const infoRows: Array<[string, string]> = [
|
||||
["Inv. Number", input.invoice.number],
|
||||
];
|
||||
if (input.invoice.matter) infoRows.push(["Matter", input.invoice.matter]);
|
||||
if (input.invoice.caseNumber) infoRows.push(["Case No.", input.invoice.caseNumber]);
|
||||
infoRows.push(["Date of Issue", formatDate(input.invoice.issueDate)]);
|
||||
if (input.invoice.terms) infoRows.push(["Terms", input.invoice.terms]);
|
||||
if (input.invoice.dueDate) infoRows.push(["Date Due", formatDate(input.invoice.dueDate)]);
|
||||
@@ -368,7 +370,8 @@ export async function downloadInvoicePdf(input: InvoicePdfInput, filename: strin
|
||||
const multipleCases = input.groups.length > 1;
|
||||
|
||||
for (const g of input.groups) {
|
||||
if (multipleCases) drawCaseHeader(g);
|
||||
// Always show the case name above its charges (per-case subtotal only when >1 case).
|
||||
drawCaseHeader(g);
|
||||
|
||||
for (const item of g.items) {
|
||||
const isNonBillable = item.billable === false;
|
||||
|
||||
@@ -207,6 +207,7 @@ function InvoiceDetail() {
|
||||
status: invoice.status,
|
||||
notes: invoice.notes,
|
||||
matter: groups.length === 1 ? (groups[0].caseRow?.title ?? null) : null,
|
||||
caseNumber: groups.length === 1 ? (groups[0].caseRow?.case_number ?? null) : null,
|
||||
},
|
||||
groups: groups.map((g) => ({
|
||||
caseNumber: g.caseRow?.case_number ?? "—",
|
||||
|
||||
Reference in New Issue
Block a user