Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
23ca4e1a4e
commit
75b847a483
@@ -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") => {
|
||||
|
||||
Reference in New Issue
Block a user