From ca092f7b8bf5d3b51f015969fb4aad6833d6b11b Mon Sep 17 00:00:00 2001 From: renee-png Date: Wed, 10 Jun 2026 11:35:36 -0400 Subject: [PATCH] Budget Workbook: step through all clients with prev/next Add prev/next buttons and a "Client N of M" indicator around the association picker so a budget can be built for every client in turn. Cycles in name order and wraps; direct dropdown selection still works. Co-Authored-By: Claude Opus 4.8 --- src/pages/BudgetWorkbookPage.tsx | 43 ++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/src/pages/BudgetWorkbookPage.tsx b/src/pages/BudgetWorkbookPage.tsx index dd21afc..35de4f4 100644 --- a/src/pages/BudgetWorkbookPage.tsx +++ b/src/pages/BudgetWorkbookPage.tsx @@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from "react"; import { useQuery, useQueryClient } from "@tanstack/react-query"; import jsPDF from "jspdf"; import autoTable from "jspdf-autotable"; -import { Building2, RefreshCw, Save, Upload, Download, FileText, Loader2, RotateCcw } from "lucide-react"; +import { Building2, RefreshCw, Save, Upload, Download, FileText, Loader2, RotateCcw, ChevronLeft, ChevronRight } from "lucide-react"; import { toast } from "sonner"; import { useAssociation } from "@/contexts/AssociationContext"; import { supabase } from "@/integrations/supabase/client"; @@ -65,6 +65,14 @@ export default function BudgetWorkbookPage() { [associations], ); + // Step through every client in order so a budget can be built for each. + const assocIdx = sortedAssoc.findIndex((a: any) => a.id === selectedAssociation?.id); + const stepAssoc = (delta: number) => { + if (sortedAssoc.length === 0) return; + const next = assocIdx < 0 ? 0 : (assocIdx + delta + sortedAssoc.length) % sortedAssoc.length; + setSelectedAssociation(sortedAssoc[next]); + }; + const from = `${fy}-01-01`; const to = monthEnd(fy, through); @@ -402,15 +410,30 @@ export default function BudgetWorkbookPage() {

Budget Workbook

Build next year's budget from YTD actuals through a chosen month.

- +
+ +
+ + {sortedAssoc.length > 0 && assocIdx >= 0 && ( + Client {assocIdx + 1} of {sortedAssoc.length} + )} +
+ +
{!associationId ? (