Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
4693058166
commit
efe324815b
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user