Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-19 18:59:35 +00:00
co-authored by renee-png
parent 23ca4e1a4e
commit 75b847a483
+2 -26
View File
@@ -198,19 +198,7 @@ function InvoicesIndex() {
toast.success(`Marked ${idArr.length} item(s) as unbilled`);
}
// Refetch invoices to refresh placeholder set + unbilled lists
const { data: inv } = await supabase
.from("invoices")
.select("*, client:clients(id, name), case:cases(id, case_number, title)")
.order("created_at", { ascending: false });
setInvoices(inv ?? []);
setPlaceholderIds(new Set(
(inv ?? [])
.filter((i: any) =>
typeof i.invoice_number === "string" &&
(i.invoice_number.startsWith("MARKED-INVOICED-") || i.invoice_number.startsWith("IMPORT-PREBILLED-"))
)
.map((i: any) => i.id),
));
await fetchInvoices();
await loadUnbilled();
if (table === "time_entries") setSelectedTime(new Set()); else setSelectedExp(new Set());
} catch (err: any) {
@@ -221,19 +209,7 @@ function InvoicesIndex() {
};
const refreshInvoices = async () => {
const { data } = await supabase
.from("invoices")
.select("*, client:clients(id, name), case:cases(id, case_number, title)")
.order("created_at", { ascending: false });
setInvoices(data ?? []);
setPlaceholderIds(new Set(
(data ?? [])
.filter((i: any) =>
typeof i.invoice_number === "string" &&
(i.invoice_number.startsWith("MARKED-INVOICED-") || i.invoice_number.startsWith("IMPORT-PREBILLED-"))
)
.map((i: any) => i.id),
));
await fetchInvoices();
};
const bulkInvoiceAction = async (action: "delete" | "sent" | "void") => {