Skip to main content

Cash Flow Statement

Cash Flow Statement

Component File: src/features/reports/components/CashFlowReport.tsx Route / navigation: Path /reports, Zustand reportTool = cash-flow-statement. See 00-REPORTS-HUB.md. Access Level: Parent Org and Fund Users with report access (position-based) Last Updated: April 12, 2026 Status: ✅ Fully Integrated with Database

P&L data parity: Uses the same fetchIncomeStatementData / get_income_statement_data path as the Income Statement — see `../../contracts/INCOME-STATEMENT-PARITY.md`.

✨ Recent Updates

Donor profile links in JE drill-down (April 6, 2026)

  • Drawer enrichment: Cash Flow ledger drill-down now requests donor attribution on its revenue/expense rows before opening JournalEntryEditDrawer.
  • Nested drawer behavior: Donation-linked rows pass donationContext, so the JE drawer can link to the donor CRM profile for single-donor entries and show aggregate donor names for split-donor entries.
  • Shared derivation: The banner amount is now calculated with the same shared helper used by other accounting/report drawers, keeping donor context consistent across surfaces.

Drill-down drawer date sync (April 2, 2026)

  • Same behavior as Income Statement: while the drawer is open, report date changes do not overwrite in-drawer dates; while closed, the drawer stays in sync; opening a line resets the drawer to the current report range.

Ledger drill-down paging & drawer refresh (March 21, 2026)

  • Same behavior as Income Statement: fetchLedgerEntriesByAccountCode() returns rows in chronological ascending order when the drawer opens; Load more appends later rows in time; hint text reports.drawer.recentEntriesFirstHint; JE save/void refetch resets to the first page.
  • Affected files: CashFlowReport.tsx, ledger-reads.ts

P&L Drawer Standardization — Running Balance Removed (March 6, 2026)

  • Changed: Drill-down drawer no longer shows "Amount" or "Balance" columns. Cash Flow accounts are P&L (period-based) — a running balance derived from cumulative historical totals is conceptually misleading.
  • New columns: Date, Description, Debit, Credit (4-column layout with account-type-aware coloring)
  • Parent + subaccount scope: Clicking a parent account (e.g., 4000) now passes additionalAccountCodes for all subaccounts. The drawer fetches the full aggregated set matching the report line total.
  • Grouped view preserved: The "Grouped / All Lines" toggle still works — grouped rows now show Debit/Credit totals instead of a signed Amount.
  • Affected files: CashFlowReport.tsx, ledger-reads.ts

December 2025

Reconciliation Status Fix (December 31, 2025)

  • Fixed: Drill-down transactions were always showing "Pending" status
  • Root cause: fetchLedgerEntriesByAccountCode() wasn't returning reconciliation metadata, and components were hardcoding a false reconciled flag
  • Solution: Map reconciliation_status (and/or RPC-computed reconciled in JSON) into the drill-down row type; Cash Flow and Comparative reports derive display badges from that
  • April 2026: Database no longer stores a reconciled BOOLEAN on journal_entry_lines; UI reconciled on report rows is derived from reconciliation_status === 'reconciled' (or RPC boolean when present)
  • Affected reports: Cash Flow Statement, Comparative Report

Database Integration

  • Fully wired to Supabase - All data fetched from journal_entry_lines table (primary ledger)
  • Chart of accounts mapping - Uses accounts.code and accounts.name columns
  • Entity filtering - Works for individual nonprofits and "All Nonprofits" aggregation
  • Real-time data - React Query with 60-second stale time

*All ledger data lives in journal_entry_lines (the ledger_entries table was dropped in January 2026).*

Drill-Down Drawer

  • All line items clickable - Both revenue and expense items open transaction drawer
  • Hover states - All rows highlight on hover with chevron indicator
  • Account + subaccount filtering - Parent account rows include matching subaccount transactions; subaccount rows show only their own transactions
  • Reconciliation status - Shows finalized R vs in-progress/clearing vs unreconciled from reconciliation_status (or derived reconciled on mapped rows)

Account Code Mapping (New Codes)

Revenue accounts use 4xxx series, expense accounts use 5xxx-6xxx series per STANDARD-CHART-OF-ACCOUNTS.md:

  • 4000 - Direct Public Support
  • 4030 - Initial Fee
  • 4040 - Interest Income
  • 4050 - Miscellaneous Revenue
  • 4100 - Admin Fees from Ministries
  • 5xxx - Operating Expenses
  • 5900 - IFM Admin Fee
  • 5895 - Reconciliation Discrepancies
  • 5899 - Ask My Accountant

Important: This report is a chart/report presentation surface. The numeric account codes shown here are ledger/chart labels from accounts.code, not instructions that posting logic hard-codes those accounts. Transaction writers still resolve account_ids through purpose-based account defaults / organization-specific mappings where applicable.

Drawer Filtering Fix (December 2025)

  • Fixed: "Sales from Inventories" renamed to "Admin Fees from Ministries" (account 4100)
  • Root cause: Label showed 4600 but data came from 4100

---

Overview

The Cash Flow Statement provides a detailed breakdown of cash inflows and outflows organized by activity type. This report follows standard nonprofit fund accounting practices, tracking cash movements from Operating Activities, with support for drill-down to view individual transactions for each line item. The statement shows how cash is received and disbursed during the reporting period.

Data source: The UI loads the same period activity as the Income Statement (fetchIncomeStatementData / get_income_statement_data). The report header accounting basis line reflects your organization’s setting in Chart of Accounts → Account Defaults — it is not a separate “cash basis books” mode. A dedicated get_cash_flow_data RPC exists in the database but is not wired to this screen yet.

UI Features

Main Features

  • Report Header:
  • Organization name
  • Date range selector (start and end dates)
  • Accounting basis line (org default); included on PDF export subtitle
  • Export button (Excel, PDF)
  • Back to Reports Hub button
  • Cash Flows from Operating Activities:
  • Cash Received:
  • 4000 - Direct Public Support (Donations)
  • 4030 - Initial Fee
  • 4040 - Interest Income
  • 4050 - Miscellaneous Revenue
  • 4100 - Admin Fees from Ministries
  • Cash Received from Operations (subtotal)
  • Cash Disbursements:
  • 5001 - Advertising Expenses
  • 5002 - Bank Fees
  • 5003 - Board Education
  • 5011 - Fundraising Expenses
  • 5013 - Insurance Premium
  • 5014 - Meals & Office Supplies
  • 5018 - Parking
  • 5019 - Payroll Expenses
  • 5020 - Postage & Mailing Service
  • 5023 - Rent
  • 5026 - Professional Services & Software
  • 5027 - Supplies
  • 5028 - Telephone/Telecommunications
  • 5031 - Transportation
  • Net Cash Flow:
  • Net Cash Provided by (Used in) Operating Activities
  • Color-coded display (green for positive, red for negative)
  • Drill-Down Feature:
  • Click any line item to view transactions
  • Transaction detail sheet with:
  • Date
  • Description
  • Debit
  • Credit
  • Reconciliation status
  • Donation-linked rows can surface donor context and a donor-profile link in the nested JE drawer

Account Code Structure

CASH FLOWS FROM OPERATING ACTIVITIES

Cash Received:
  4000 - Direct Public Support          $47,204.68
  4030 - Initial Fee                     $2,500.00
  4040 - Interest Income                   $150.00
  4050 - Miscellaneous Revenue             $300.00
  4100 - Admin Fees from Ministries      $1,200.00
  ───────────────────────────────────────────────
  Cash Received from Operations         $51,354.68

Cash Disbursements:
  5001 - Advertising Expenses            $2,855.35
  5002 - Bank Fees                       $1,432.01
  5003 - Board Education                     $0.00
  5011 - Fundraising Expenses                $0.00
  5013 - Insurance Premium                   $0.00
  5014 - Meals                               $0.00
  5018 - Parking                             $0.00
  5019 - Payroll Expenses               $12,874.16
  5020 - Postage & Mailing Service           $0.00
  5023 - Rent                            $1,500.00
  5026 - Professional Services               $0.00
  5027 - Supplies                            $0.00
  5028 - Telephone/Telecommunications       $86.53
  5031 - Transportation                      $0.00
  5032 - Travel & Meetings                   $0.00
  5033 - Donor Appreciation                  $0.00
  5034 - Business Expenses                  $70.38
  6001 - Reconciliation Discrepancies        $0.00
  6004 - Ask My Accountant                   $0.00
  ───────────────────────────────────────────────
  Total Cash Disbursements             ($18,818.43)

  Net Cash Provided by Operating Activities  $32,536.25

The amounts/codes in this block are an illustrative sample report layout, not a hard-coded posting map.

Current Implementation Notes

Report Inputs

  • entityId - Current organization / parent-org / all-org selection
  • startDate / endDate - Report period used for both the summary body and the drawer default
  • accountType - Revenue vs expense context used for drill-down styling and sign interpretation

Drawer Inputs

  • accountCode - Primary chart-of-accounts code that was clicked in the report body
  • additionalAccountCodes - Optional subaccount codes included when a parent row is clicked
  • drawerDateRange - Independent date range inside the drawer

Returned Drawer Fields

  • debit / credit - Raw journal-entry amounts shown in the drawer table
  • displayDate - Void-aware display date from applyVoidedEntryDisplay()
  • reconciled (UI field) - Derived reconciliation badge / indicator (not a physical DB column after Apr 2026)
  • entryNumber / referenceType - Used for grouped journal-entry display and void markers

Access & Permissions

  • Requires report read access to view the report
  • Requires report export access to use CSV / Excel / PDF export flows
  • Parent-org users can review consolidated activity; fund users are limited to their scoped organizations

Validation & Error States

  • Start and end dates are required
  • End date must not precede start date
  • Export surfaces toast feedback on failure
  • Empty periods render the no-data state rather than a partial table

Loading States

  • Initial report load uses skeleton / placeholder UI
  • Date changes preserve prior data while React Query refetches
  • Drawer fetches show loading state independently from the main report
  • Export actions show toast-based success/failure feedback

State Management

  • Report date range - Main reporting period
  • Drawer date range - Independent drill-down filtering inside the drawer
  • selectedLineItem - Active revenue/expense account for drill-down
  • expandedAccounts - Parent/subaccount expand-collapse state in the report body
  • groupByTransaction / expandedGroups - Drawer grouping state
  • exportDialogOpen - Multi-nonprofit export dialog state

Key UI Dependencies

  • ReportDateRangeSelector
  • StackedDrawerRoot / StackedDrawerContent
  • JournalEntryEditDrawer
  • MultiNonprofitExportDialog
  • Export utilities in src/lib/exportUtils

Synced from IFMmvp-Frontend documentation: pages/reports/03-CASH-FLOW-REPORT.md

Ready to Get Started?

See how Alignmint can simplify your nonprofit's operations. Schedule a free demo with our team and we'll walk you through everything.

Questions? Email us at steven@getalignmint.org

Ready to get started?Start Plus Trial