{(['QUOTATION', 'PROFORMA', 'INVOICE'] as const).map((t) => (
))}
@@ -191,97 +198,68 @@ export function NewDocument() {
const mod = modules.data?.find((m) => m.id === l.moduleId)
const prices = pricesByModule[l.moduleId] ?? []
const editions = editionsOf(prices)
+ const priceGap = warnings.some((w) => mod !== undefined && w.includes(mod.code))
return (
-
-
{editions.length > 1 && (
- {
- const edition = e.target.value
- setLine(i, { edition })
- if (l.moduleId !== '' && l.kind !== '') prefill(i, l.moduleId, l.kind, edition)
- }}
- >
- {editions.map((ed) => {
- const p = editionPrice(prices, ed, l.kind)
- return
- })}
+ { const edition = e.target.value; setLine(i, { edition }); if (l.moduleId !== '' && l.kind !== '') prefill(i, l.moduleId, l.kind, edition); commit() }}>
+ {editions.map((ed) => { const p = editionPrice(prices, ed, l.kind); return })}
)}
- setLine(i, { qty: e.target.value })} />
+ setLine(i, { qty: e.target.value })} onBlur={commit} />
- setLine(i, { unitRs: e.target.value })} />
+ setLine(i, { unitRs: e.target.value })} onBlur={commit} />
- setLine(i, { description: e.target.value })} />
+ setLine(i, { description: e.target.value })} onBlur={commit} />
-
{lines.length > 1 && (
-
+
)}
)
})}
-
- Subtotal {formatINR(subtotalPaise)} + GST (server-computed)
+
-
{modules.error !== undefined && {modules.error}}
@@ -290,16 +268,47 @@ export function NewDocument() {