- | {it.work_date ? formatDate(it.work_date) : "—"} |
-
- {canEdit && isDraft ? (
- e.target.value !== it.description && updateItem(it.id, { description: e.target.value })} />
- ) : (
-
- {it.description}
- {it.user?.full_name && {it.user.full_name} }
-
- )}
- |
-
- {canEdit && isDraft ? (
- Number(e.target.value) !== Number(it.quantity) && updateItem(it.id, { quantity: Number(e.target.value) })} />
- ) : Number(it.quantity).toFixed(2)}
- |
-
- {canEdit && isDraft ? (
- Number(e.target.value) !== Number(it.rate) && updateItem(it.id, { rate: Number(e.target.value) })} />
- ) : formatCurrency(it.rate)}
- |
- {formatCurrency(it.amount)} |
- {canEdit && isDraft && (
-
-
+ {g.subsections.map((sub) => (
+
+
+ |
+ {sub.label}
|
- )}
-
+
+ {sub.billable ? formatCurrency(sub.subtotal) : "—"}
+ |
+ {canEdit && isDraft && | }
+ |
+ {sub.items.map((it) => (
+
+ | {it.work_date ? formatDate(it.work_date) : "—"} |
+
+ {canEdit && isDraft ? (
+ e.target.value !== it.description && updateItem(it.id, { description: e.target.value })} />
+ ) : (
+
+ {it.description}
+ {it.user?.full_name && {it.user.full_name} }
+
+ )}
+ |
+
+ {canEdit && isDraft ? (
+ Number(e.target.value) !== Number(it.quantity) && updateItem(it.id, { quantity: Number(e.target.value) })} />
+ ) : Number(it.quantity).toFixed(2)}
+ |
+
+ {canEdit && isDraft ? (
+ Number(e.target.value) !== Number(it.rate) && updateItem(it.id, { rate: Number(e.target.value) })} />
+ ) : formatCurrency(it.rate)}
+ |
+
+ {sub.billable ? formatCurrency(it.amount) : "—"}
+ |
+ {canEdit && isDraft && (
+
+
+ |
+ )}
+
+ ))}
+
))}