Skip to content

feat(shillinq): build reporting-cash-flow-statement - #3177

Open
rubenvdlinde wants to merge 6 commits into
developmentfrom
quality/build-reporting-cash-flow-statement
Open

rubenvdlinde wants to merge 6 commits into
developmentfrom
quality/build-reporting-cash-flow-statement

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Builds openspec/changes/reporting-cash-flow-statement: a cash flow statement by the indirect method from posted ledger lines, shown as its own page and carried into the annual accounts.

Tasks done

  • 1.1 Account.cashFlowCategory (cash, working-capital, fixed-assets, financing, equity) in lib/Settings/register.d/zz-reporting-cash-flow-statement.json, Account 0.5.0. The fragment is named zz- so its schema version is the last one merged. The app version moves to 0.5.7-unstable.20261117153000 and the lock records it. Page CashFlowAccountCheck lists the balance accounts without a category and opens each one on its account page. Seed: account 1000 in bookkeeping-sbr-xbrl-reporting.json is working-capital. The three seed accounts in shillinq_register.json stay unclassified, because ADR-037 says not to edit that file. 1300 Debiteuren is the spec's own example for the check page.
  • 2.1 lib/Reporting/CashFlowCalculator.php::between() over two new StatementCalculator methods, cashFlowMovements() and accountsByNumber():
    • operating = result + depreciation + working-capital movements;
    • investing = fixed-asset movements without depreciation;
    • financing = financing and equity movements;
    • every uncategorised balance account goes on a "Niet ingedeeld" line with its name.
    • Depreciation is the credit, within the period, on the accumulated depreciation accounts the fixed assets name.
    • Year-closing entries (journalType: closing) are left out on both sides.
    • The result also carries the opening, change and closing cash, plus a summary row list. The reconciliation difference is reported, never hidden.
  • 2.2 GET /api/statements/cash-flow?from&to&administrationId on FinancialStatementController, with the same checks as the other statements: 401 without a user, 400 for a bad range or no administration, and a masked 404 for another administration before anything is read. It is documented in openapi.json.
  • 3.1 (in part) The FinancialStatementCashFlow dashboard (/reports/cash-flow, with a date range) and its card on the Reports page.
  • 3.2 AnnualAccountsReportGenerator adds a kasstroomoverzicht from the same calculator. It is followed by a reconciliation table. CashFlowStatementRecord stores the figures as the annual report's CashFlowStatement with method: indirect. A draft is updated and a final record is left alone. Without an AnnualReport for that year, nothing is stored.
  • 4.2 English and Dutch strings (l10n/*.json; the .js files are regenerated).

Tasks left, and why

  • 3.1, figure links: a figure opens its account page, not the posted lines of the period. The LedgerLinesForAccount page belongs to reporting-financial-statements task 2.3, which is not built yet. Every row already carries accountNumber, from and to for it.
  • 4.1 Playwright e2e: needs a live instance.

Tests

  • CashFlowCalculatorTest (7): the design's seed (operating 48,000, investing -12,000, financing -8,000, cash +28,000, opening 20,000 and closing 48,000), the row shape, an unclassified 500, a closing entry inside the period, no depreciation without a fixed asset, and the opening cash.
  • CashFlowStatementRecordTest (4), AnnualAccountsCashFlowTest (4), and FinancialStatementControllerTest (+2: the endpoint and its refusals).
  • For each new test file, one subject line was broken and the tests failed.
  • PHP unit suite: development 12,795 OK; this branch 12,813 OK.
  • Vitest: 3,095 passed and 1 failed. The failure (dunningNextRun.spec.js) fails on development too.
  • check:manifest, check:manifest-shell, check:registers, check:seeds, test:l10n, test:l10n-parity, check:l10n-js and openspec validate --strict pass. phpcs and phpstan are clean on the touched lib files.
  • check:nav-reachability: the new page has a Reports-card entry in the baseline. The two orphans it still reports are on development too.
  • check:manifest-budget and check:schema-l10n already fail on development; the four new schema strings are covered.

Generated by Claude Code

The cash flow calculator by the indirect method over the statement calculator (task 2.1), GET /api/statements/cash-flow with the statement endpoints' checks (task 2.2), and Account.cashFlowCategory (task 1.1, schema part).

Assisted-by: ClaudeCode:claude-opus-5-5
Record the Account 0.5.0 register move under app version 0.5.7-unstable.20261117153000 and document GET /api/statements/cash-flow in openapi.json.

Assisted-by: ClaudeCode:claude-opus-5-5
The annual accounts gain a kasstroomoverzicht from the cash flow calculator and keep it as the annual report's CashFlowStatement with method indirect (task 3.2).

Assisted-by: ClaudeCode:claude-opus-5-5
The cash flow statement page with its Reports card and the account check page (tasks 1.1, 3.1 in part), Dutch and English strings (task 4.2), and the tasks ticked.

Assisted-by: ClaudeCode:claude-opus-5-5
Write the Playwright spec of task 4.1: the reconciliation on the
statement endpoint, the page and its account check, and a figure click.

Assisted-by: ClaudeCode:claude-opus-5-5
Task 3.1: every cash flow figure opens the posted ledger lines behind it.
Each row carries a linesKey (account, result or depreciation, and the
range); GET /api/statements/cash-flow/lines returns the lines, which add
up to the figure, behind the same administration check as the statement.
The new CashFlowLines page reads it from its route and opens each line's
transaction. Unit tests for the calculator and controller, a vitest
contract over the manifest, and the e2e figure step follows the new page.

Assisted-by: ClaudeCode:claude-opus-5-5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant