form of converet

This commit is contained in:
hamid zarghami
2026-02-21 16:42:23 +03:30
parent f2ebdc9836
commit 502e8c538f
6 changed files with 205 additions and 7 deletions
+7 -7
View File
@@ -132,13 +132,13 @@ const UpdateInvoice: FC = () => {
const mappedItems: CreatePreInvoiceItemType[] =
invoice.items?.length > 0
? invoice.items.map((i) => ({
id: i.id,
productId: i.product?.id ?? "",
quantity: i.quantity ?? 1,
unitPrice: i.unitPrice ?? 0,
discount: i.discount ?? 0,
description: i.description ?? "",
}))
id: i.id,
productId: i.product?.id ?? "",
quantity: i.quantity ?? 1,
unitPrice: i.unitPrice ?? 0,
discount: i.discount ?? 0,
description: i.description ?? "",
}))
: [createEmptyItem()];
setItems(mappedItems);