Skip to content

Add a super statement form for Australian super funds - #17

Open
GrantCharge wants to merge 1 commit into
nextwork-projects:mainfrom
GrantCharge:super-statement-upstream
Open

GrantCharge wants to merge 1 commit into
nextwork-projects:mainfrom
GrantCharge:super-statement-upstream

Conversation

@GrantCharge

Copy link
Copy Markdown

What

Australians get a new Add a super statement card on Accounts, Add accounts. It shows only when the profile country is Australia.

The form asks for:

  • The fund: a new one, or an existing manual super account
  • The date the statement runs to. It starts at the last 30 June.
  • The closing balance
  • Before-tax (concessional) contributions. This is optional.

Why

A super fund's annual statement is a summary table, not dated rows. The PDF importer can't read it. Before this, the only way in was a bank account with a typed transaction.

How it works

  • New fund: adds a manual account with type: investment, subtype: superannuation and current_balance set to the closing balance.
  • Later statements: add one transaction that moves the balance to the new closing figure. For a manual investment account, balance() is current_balance minus the sum of amounts (migration 0031). So a rise of X is an amount of -X. The row is ignored: true, so it doesn't count as income or spending.
  • Contributions: saved to user_metadata.contributed["super:<tax year>"]. The Contributions card already reads this key. A past year's figure is kept but doesn't change this year's cap. The form says so.
  • A manual account counts as super when it is an investment and its name or subtype matches super|smsf. This is the same match invest.ts uses.

No database changes. No AI path changes. Advice stays country based: the card uses countryOf and shows for AU only.

Files

  • src/lib/super-statement.ts: pure tax-year and balance helpers
  • src/lib/super-statement.test.ts: run with node src/lib/super-statement.test.ts
  • src/components/SuperStatement.tsx: the form
  • src/components/AddAccounts.tsx and src/app/(app)/accounts/add/page.tsx: show the card

Checks

  • npx tsc --noEmit: passes
  • npm run lint: no errors. The 6 warnings were already on main.
  • node src/lib/super-statement.test.ts: passes

Not yet tried in a running app. Please try it once with an AU profile. Add a fund. Then add a second statement for it and check the balance moves to the new closing figure.

🤖 Generated with Claude Code

Super statements are yearly summaries, so the PDF importer can't read them.
Australians can now type in a fund's closing balance and before-tax
contributions. A new fund becomes a manual investment account. A later
statement adds one ignored entry that moves the balance to the new closing
figure. Contributions are saved under the statement's tax year.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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