### Summary
Adds a new Cash Flow Manual Entry surface to the Monthly Financial Reporting (MFR) workflow so Finance can enter the Adjusted-EBITDA-anchored cash flow statement cell-by-cell instead of going CSV-only. Values are pre-filled from existing MFR data (Group/Software/Education Adjusted EBITDA, MR & Import, Loans, Interest, IP / Import / Restructuring add-backs), stored per-period in a new DynamoDB table, and layered into the on-screen Cash Flows view plus all three exported memo docs (Group, Software, Education) so the docx export matches what Finance sees.
### Business Value
Gives Finance a structured, deterministic way to produce the monthly cash flow statement — replacing the previous CSV-only flow that required hand-built spreadsheets per entity. Reviewers see the same numbers in the UI and the exported memo, eliminating reconciliation errors and shortening the monthly close cycle. Prior-year comparatives are populated automatically, so historical context is always present without extra Finance work.
### Changes
- New DynamoDB-backed storage service ([cash_flow_manual_entry_storage_service.py](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-api/services/cash_flow_manual_entry_storage_service.py)) — per-period upserts of user-entered cells with updated_by/updated_at provenance; lazy table creation mirrors the existing CSV upload service.
- New prefill aggregator ([cash_flow_manual_entry_service.py](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-api/services/cash_flow_manual_entry_service.py)) — read-only projection of Group cash flow + Adjusted EBITDA breakdowns (Group / Software / Education) into the CF_MANUAL_ROWS matrix; sign-flips IP / Import / Restructuring add-backs to cash-flow convention.
- New memo overrides service ([cash_flow_manual_entry_memo_overrides_service.py](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-api/services/cash_flow_manual_entry_memo_overrides_service.py)) — Python mirror of the frontend useCashFlowManualEntryMemoOverrides hook with per-entity row → line-item mappings, Adjustments-to-Net-Income back-calc so the memo's operating subtotal ties to op:net-cash, and Software-only cash-position synthesis sourced from Group.
- Three new FastAPI endpoints under /monthly-financial-reporting: GET /cash-flow-manual-entry-prefill, GET /cash-flow-manual-entry, PUT /cash-flow-manual-entry.
- DOCX memo wiring ([group.py](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-api/services/docx_reports/memo_data/group.py), [software.py](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-api/services/docx_reports/memo_data/software.py), [education.py](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-api/services/docx_reports/memo_data/education.py)) — layers manual-entry overrides on top of the existing CSV-upload layer with fill-blank semantics; failures are logged and the export continues without overrides.
- New manual entry UI ([CashFlowManualEntryView.tsx](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-client/src/features/monthly-financial-reporting/components/CashFlowManualEntryView.tsx)) — 5-column editable table (gaap / elim / inner / education / passive_investments) with live Silo & Software residuals, animated skeleton load, ~600ms debounced save, optimistic revert on save failure, click-to-drill on prefilled cells.
- Manual entry support library ([components/manual-entry/](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-client/src/features/monthly-financial-reporting/components/manual-entry/)) — row inventory, math engine, drill-down map, NumericCell input component, and dedicated unit tests for each.
- Cash Flow Upload view restructured — old [CashFlowUploadView.tsx](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-client/src/features/monthly-financial-reporting/components/CashFlowUploadView.tsx) becomes a tab shell hosting CashFlowManualEntryView (default) and the existing CSV flow extracted to [CashFlowCsvUploadView.tsx](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-client/src/features/monthly-financial-reporting/components/CashFlowCsvUploadView.tsx).
- EBITDA detail panel gains an excludeGroups prop so Silo drill-downs on Adjusted EBITDA can show Group consolidated minus Education with a recomputed grand total.
- New frontend hooks: useCashFlowManualEntryPrefill, useCashFlowManualEntryStored, useCashFlowManualEntrySave, useCashFlowManualEntryDetailPanel, [useCashFlowManualEntryMemoOverrides](vscode-webview://15qdonnjjcq9q3pcmufmg5fa0asnqc6qnceup60m8cm6igoedkcj/klair-client/src/features/monthly-financial-reporting/hooks/useCashFlowManualEntryMemoOverrides.ts) (covers current + prior-year periods for memo comparatives).
- useFinancialStatementData / useAllFinancialStatements extended to accept manual-entry overrides and a loading flag so the cash flows table defers rendering until overrides are current.
- New utils applyBudgetOverrides.ts and formatThousands.ts; new override-application unit tests; spec coverage added to Group / Software / Education memo views.
- Comprehensive test coverage: 4 new backend test files (endpoints, prefill aggregator, storage service, memo overrides) and 5 new frontend specs (view, calculate, rows, hook, apply-overrides utility).
### Testing
Prerequisites
- klair-api/: uv sync, then uv run fast_endpoint.py.
- klair-client/: pnpm install, then pnpm dev.
- Be authenticated via Clerk; AWS creds available so the new DynamoDB table can be auto-created on first PUT.
### Steps
1. From the client, open the MFR screen at the link below and pick a recent reporting period (e.g. Jan-26).
2. In the left nav, open Cash Flow Upload — confirm it now shows two tabs and Manual Entry is selected by default.
3. Verify the table renders with the Adjusted-EBITDA-anchored layout (Adjusted EBITDA, IP / Import / Restructuring, MR & Import, Loans, Interest pre-populated).
4. Click a prefilled drill-down cell (e.g. Adjusted EBITDA → Silo) — the detail side panel should open with the breakdown.
5. Edit a few editable cells (e.g. op:wc-ar, fin:capital, inv:pbc) in different columns. Confirm Silo / Software residuals and section subtotals recompute live.
6. Wait ~1 second after typing — the value should persist (check the network tab for PUT /cash-flow-manual-entry).
7. Reload the page; entered values should re-appear after the seed effect resolves.
8. Switch to the Financial Statements view → Cash Flows table — confirm manual-entry overrides appear on rows the backend left blank (e.g. PBC, Capital infusion) while backend-authoritative rows (MR & Import, Loans, Interest) are untouched.
9. Switch to the Group Memo, then the Software Memo, then the Education Memo — each cash flow section should show the entered values; Software memo should also show synthesized cash-position rows.
10. Export each memo to docx — open the file and confirm the cash flow section matches what the UI shows, including the back-calc'd Adjustments-to-Net-Income line so "Net cash provided by operating activities" lines up.
11. Clear an editable cell to empty — confirm it persists as blank (does not revert to seed).
### Expected Result
- Manual entries persist across reloads and entity switches.
- Drill-downs open the correct detail panel without errors.
- The exported docx for all three memos shows the manual-entry values, with the operating subtotal tying to op:net-cash.
- No console errors; pnpm lint:pr and pnpm test pass.
### Link
http://localhost:3001/monthly-financial-reporting
### Pages Affected
Monthly Financial Reporting — Cash Flow Upload (new Manual Entry tab + existing CSV tab): http://localhost:3001/monthly-financial-reporting
Monthly Financial Reporting — Financial Statements (Cash Flows table now layers manual-entry overrides): http://localhost:3001/monthly-financial-reporting
Monthly Financial Reporting — Group / Software / Education Memos (CF sections + docx export): http://localhost:3001/monthly-financial-reporting
https://github.com/user-attachments/assets/96e73fc9-80eb-470d-82c4-6c0c54705d94