|
|
|
|
@ -72,7 +72,11 @@ export function PlanDialog(props: {
|
|
|
|
|
setSaving(true)
|
|
|
|
|
const body = {
|
|
|
|
|
clientModuleId: f.clientModuleId, cadence: f.cadence, nextRun: f.nextRun, policy: f.policy,
|
|
|
|
|
...(amount !== undefined ? { amountPaise: fromRupees(amount) } : {}),
|
|
|
|
|
// Edit mode: blank means "revert to price book" — send an explicit null so it clears.
|
|
|
|
|
// Create mode: blank just omits the override, letting the price book resolve at generation time.
|
|
|
|
|
...(editing
|
|
|
|
|
? { amountPaise: amount !== undefined ? fromRupees(amount) : null }
|
|
|
|
|
: amount !== undefined ? { amountPaise: fromRupees(amount) } : {}),
|
|
|
|
|
}
|
|
|
|
|
const call = editing ? updateRecurringPlan(props.initial!.id, body) : createRecurringPlan(props.clientId, body)
|
|
|
|
|
call
|
|
|
|
|
@ -219,8 +223,14 @@ export function InteractionDialog(props: {
|
|
|
|
|
setSaving(true)
|
|
|
|
|
const body = {
|
|
|
|
|
typeCode: f.typeCode, onDate: f.onDate, notes: f.notes,
|
|
|
|
|
...(f.outcome !== '' ? { outcome: f.outcome } : {}),
|
|
|
|
|
...(f.followUpOn !== '' ? { followUpOn: f.followUpOn } : {}),
|
|
|
|
|
// Edit mode: blank means "clear it" — send an explicit null so the server clears the column
|
|
|
|
|
// (same semantics as ClientDetail's inline follow-up quick-edit). Create mode omits when blank.
|
|
|
|
|
...(editing
|
|
|
|
|
? { outcome: f.outcome !== '' ? f.outcome : null, followUpOn: f.followUpOn !== '' ? f.followUpOn : null }
|
|
|
|
|
: {
|
|
|
|
|
...(f.outcome !== '' ? { outcome: f.outcome } : {}),
|
|
|
|
|
...(f.followUpOn !== '' ? { followUpOn: f.followUpOn } : {}),
|
|
|
|
|
}),
|
|
|
|
|
}
|
|
|
|
|
const call = editing ? updateInteraction(props.initial!.id, body) : createInteraction(props.clientId, body)
|
|
|
|
|
call
|
|
|
|
|
|