From ac454e8f5eab295969da1061a69ee6ba1962bda7 Mon Sep 17 00:00:00 2001 From: renee-png Date: Sat, 13 Jun 2026 18:13:56 -0400 Subject: [PATCH] Reports: drop Income Statement, add Monthly columns view to P&L MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Income Statement was a duplicate of the P&L, so removed it from the report menu. The P&L now has a 'Monthly columns' toggle that renders the same multi-period (by month/quarter/year) breakdown the income statement provided — relabeled 'Profit & Loss'. Default P&L view is unchanged (single period). Co-Authored-By: Claude Opus 4.8 --- .../accounting/AccountingReportsPage.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/pages/accounting/AccountingReportsPage.tsx b/src/pages/accounting/AccountingReportsPage.tsx index a9aa559..17c719a 100644 --- a/src/pages/accounting/AccountingReportsPage.tsx +++ b/src/pages/accounting/AccountingReportsPage.tsx @@ -53,7 +53,6 @@ const FINANCIAL: ReportId[] = ["pnl", "balance-sheet", "cash-flow", "movement-of const GROUPS = [ { name: "Business Overview", reports: [ { id: "pnl" as ReportId, name: "Profit & Loss" }, - { id: "income-statement" as ReportId, name: "Income Statement" }, { id: "balance-sheet" as ReportId, name: "Balance Sheet" }, { id: "cash-flow" as ReportId, name: "Cash Flow Statement" }, { id: "movement-of-equity" as ReportId, name: "Movement of Equity" }, @@ -329,6 +328,7 @@ export default function AccountingReportsPage({ association }: { association?: { // Toggles const [showCodes, setShowCodes] = useState(false); const [showZero, setShowZero] = useState(false); + const [pnlMonthView, setPnlMonthView] = useState(false); const { data: companyMeta } = useQuery({ queryKey: ["company-fy", cid], @@ -469,7 +469,8 @@ export default function AccountingReportsPage({ association }: { association?: { }, [active, arOpen, data, flat, structured, cur, activeMeta.name]); // Reports whose export is handled internally (own PDF/CSV buttons inside the component) - const hasOwnExport = active === "trial-balance" || active === "general-ledger" || active === "budget-vs-actuals" || active === "income-statement" + const hasOwnExport = active === "trial-balance" || active === "general-ledger" || active === "budget-vs-actuals" + || (active === "pnl" && pnlMonthView) || active === "ar-aging-property" || active === "prepaid-homeowners" || active === "cash-disbursement"; const anyExportable = !!(structured || flat || exportFlat); @@ -646,6 +647,9 @@ export default function AccountingReportsPage({ association }: { association?: {
+ {active === "pnl" && ( + + )}
@@ -653,7 +657,7 @@ export default function AccountingReportsPage({ association }: { association?: { {active === "budget-vs-actuals" && ( )} - {active === "income-statement" && ( + {active === "pnl" && pnlMonthView && ( )} {active === "trial-balance" && ( @@ -679,7 +683,7 @@ export default function AccountingReportsPage({ association }: { association?: { )} - {isFinancial && ( + {isFinancial && !(active === "pnl" && pnlMonthView) && ( !data ? (
Loading…
) : structured ? ( @@ -927,7 +931,7 @@ function IncomeStatementReport({ companyId, companyName, from, to, currency, log const doc = new jsPDF({ unit: "pt", format: "letter", orientation: "landscape" }); const logo = await loadBrandedLogo(logoUrl); const startY = drawBrandedHeader(doc, { - logo, title: "Income Statement", subtitle, + logo, title: "Profit & Loss", subtitle, metaLines: [{ label: "Properties:", value: companyName }], }); const head = [["Account", ...periods.map((p) => p.label), "Total"]]; @@ -973,7 +977,7 @@ function IncomeStatementReport({ companyId, companyName, from, to, currency, log }, }); drawBrandedFooter(doc); - doc.save(`income-statement-${gran}-${from}-to-${to}.pdf`); + doc.save(`profit-loss-${gran}-${from}-to-${to}.pdf`); }; const exportCsv = () => { @@ -997,7 +1001,7 @@ function IncomeStatementReport({ companyId, companyName, from, to, currency, log const blob = new Blob([lines.join("\n")], { type: "text/csv" }); const a = document.createElement("a"); a.href = URL.createObjectURL(blob); - a.download = `income-statement-${gran}-${from}-to-${to}.csv`; + a.download = `profit-loss-${gran}-${from}-to-${to}.csv`; a.click(); URL.revokeObjectURL(a.href); }; @@ -1034,7 +1038,7 @@ function IncomeStatementReport({ companyId, companyName, from, to, currency, log ) : !hasRows ? ( No income or expense activity in this range. ) : ( - +