From 469305816672fe096b8daa530fcc47f61a9afdf8 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 23:14:55 +0000 Subject: [PATCH 1/3] Work in progress --- src/routeTree.gen.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 908955b..92d70af 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -1335,3 +1335,12 @@ const rootRouteChildren: RootRouteChildren = { export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) ._addFileTypes() + +import type { getRouter } from './router.tsx' +import type { createStart } from '@tanstack/react-start' +declare module '@tanstack/react-start' { + interface Register { + ssr: true + router: Awaited> + } +} From efe324815bb3e4679bf6d4d0a7d234971997e891 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 23:15:26 +0000 Subject: [PATCH 2/3] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/invoices.$invoiceId.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/invoices.$invoiceId.tsx b/src/routes/invoices.$invoiceId.tsx index 0568b1b..2455df9 100644 --- a/src/routes/invoices.$invoiceId.tsx +++ b/src/routes/invoices.$invoiceId.tsx @@ -193,14 +193,15 @@ function InvoiceDetail() { load(); }; - const addManualItem = async (caseId: string | null) => { + const addManualItem = async (caseId: string | null, kind: "manual" | "expense" = "manual") => { setSavingItem(true); const sort_order = items.length ? Math.max(...items.map((i) => i.sort_order)) + 1 : 0; const { error } = await supabase.from("invoice_line_items").insert({ invoice_id: invoiceId, case_id: caseId, - kind: "manual", + kind, description: "New line", + work_date: new Date().toISOString().slice(0, 10), quantity: 1, rate: 0, amount: 0, From eaa7f7e5443da75e89579dd8ca9b62d8c818f667 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 23:15:39 +0000 Subject: [PATCH 3/3] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routeTree.gen.ts | 9 --------- src/routes/invoices.$invoiceId.tsx | 14 +++++++++++++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 92d70af..908955b 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -1335,12 +1335,3 @@ const rootRouteChildren: RootRouteChildren = { export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) ._addFileTypes() - -import type { getRouter } from './router.tsx' -import type { createStart } from '@tanstack/react-start' -declare module '@tanstack/react-start' { - interface Register { - ssr: true - router: Awaited> - } -} diff --git a/src/routes/invoices.$invoiceId.tsx b/src/routes/invoices.$invoiceId.tsx index 2455df9..a474882 100644 --- a/src/routes/invoices.$invoiceId.tsx +++ b/src/routes/invoices.$invoiceId.tsx @@ -440,7 +440,19 @@ function InvoiceDetail() { {sub.items.map((it) => ( - {it.work_date ? formatDate(it.work_date) : "—"} + + {canModify ? ( + + e.target.value !== (it.work_date ?? "") && + updateItem(it.id, { work_date: e.target.value || null }) + } + /> + ) : it.work_date ? formatDate(it.work_date) : "—"} + {canModify ? (