Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
15a8c86684
commit
bad5139cd3
@@ -153,6 +153,24 @@ export function GenerateInvoiceDialog({ open, onOpenChange, clientId, clientName
|
||||
navigate({ to: "/invoices/$invoiceId", params: { invoiceId: inv.id } });
|
||||
return;
|
||||
}
|
||||
if (splitPerCase && selectedIds.length > 1) {
|
||||
const results: { id: string; number: string }[] = [];
|
||||
for (const cid of selectedIds) {
|
||||
const r = await generateInvoiceForClient({
|
||||
clientId,
|
||||
caseIds: [cid],
|
||||
createdBy: user.id,
|
||||
taxRate: (Number(taxPct) || 0) / 100,
|
||||
dueDays: Number(dueDays) || 30,
|
||||
notes: notes || undefined,
|
||||
});
|
||||
results.push({ id: r.invoiceId, number: r.invoiceNumber });
|
||||
}
|
||||
toast.success(`${results.length} invoices created`);
|
||||
onOpenChange(false);
|
||||
navigate({ to: "/invoices" });
|
||||
return;
|
||||
}
|
||||
const { invoiceId, invoiceNumber } = await generateInvoiceForClient({
|
||||
clientId,
|
||||
caseIds: selectedIds,
|
||||
|
||||
Reference in New Issue
Block a user