From 333bcf633a69073ff907254fc2b0e333fa6e55bd Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 17:15:49 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/settings.import.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index 5873da6..bf92579 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -969,9 +969,13 @@ function ImportPage() { } } - // Mark as already invoiced via placeholder voided invoice (per client) - if (clientId && !row.invoice_id) { - const invId = await ensurePreInvoicedInvoice(clientId, caseId); + // Link to a real invoice ONLY when the source row provided an + // invoice number. Otherwise leave invoice_id null so the user can + // bill these items normally later. + const invNumber = row._invoice ? String(row._invoice).trim() : ""; + delete row._invoice; + if (invNumber && clientId && !row.invoice_id) { + const invId = await ensureNamedInvoice(clientId, caseId, invNumber); if (invId) row.invoice_id = invId; }