diff --git a/src/components/collections/payment-plans-panel.tsx b/src/components/collections/payment-plans-panel.tsx index 773d33c..33bff81 100644 --- a/src/components/collections/payment-plans-panel.tsx +++ b/src/components/collections/payment-plans-panel.tsx @@ -281,6 +281,7 @@ export function PaymentPlansPanel({ open={createOpen} onOpenChange={setCreateOpen} collectionId={collectionId} + caseId={caseId ?? null} userId={user?.id} onSaved={load} /> @@ -302,12 +303,14 @@ function CreatePlanDialog({ open, onOpenChange, collectionId, + caseId, userId, onSaved, }: { open: boolean; onOpenChange: (v: boolean) => void; collectionId: string; + caseId?: string | null; userId?: string; onSaved: () => void; }) { @@ -345,6 +348,7 @@ function CreatePlanDialog({ .from("payment_plans") .insert({ collection_id: collectionId, + case_id: caseId ?? null, name: name || null, total_amount: t, down_payment: parseFloat(down) || 0,