Epic: Annual audit — fix wrong numbers and broken controls (FY2025 close review, section A)
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Read docs/annual-audit-workflow/fy2025-close-review.md section 2.A and the listed entry points: packages/server/src/modules/reports/helpers/tax.helper.ts, the financial ledger generation resolvers, packages/server/src/modules/ledger/resolvers/ledger.resolver.ts, and the annual audit workflow step files. Work through sub-issues #5086–#5092 in the suggested order; use their tests and verify regenerated FY2025 charges leave no pending ledger changes. Done when all sub-issues are closed and the FY2025 review document is updated.
Written by the indexing model from the issue text.
Description
Goal
Fix the calculations and controls in the annual-audit workflow (/workflows/annual-audit/:year) that put wrong numbers into the annual statements and the tax return, or let closed figures change after the close.
Background
These items come from the FY2025 close review: docs/annual-audit-workflow/fy2025-close-review.md, section 2.A, based on main at 85507ae.
This epic covers only the findings that affect the numbers or the close control. Other findings in the review are out of scope here:
- missing filings;
- reconciliations;
- step-status issues.
How the pieces fit (read before picking up a sub-issue)
- Year-end charges (workflow step 4).
packages/client/src/components/screens/operations/annual-audit/step-04-financial-charges/index.tsxcalls thegenerate*Chargemutations inpackages/server/src/modules/charges/resolvers/financial-charges.resolver.ts.- Each mutation creates a FINANCIAL charge tagged with a tax category (
generateAndTagCharge). The charge's description carries the year, e.g.Tax expenses charge for 2025. generateLedgerRecordsForFinancialCharge(packages/server/src/modules/ledger/resolvers/ledger-generation/financial-ledger-generation.resolver.ts) then dispatches on the charge's tax category to a per-type generator under.../financial-ledger-generation/.- The generators recompute their amounts every time the ledger is regenerated.
- Ledger-drift detection (steps 2 and 7).
chargesWithLedgerChanges(packages/server/src/modules/ledger/resolvers/ledger.resolver.ts) regenerates every charge of the year and diffs it against the stored ledger.- After a generator fix, existing year-end charges show up as "pending ledger changes" until they are regenerated.
- That is the migration path for existing data. The calculation fixes need no SQL migration.
- Tax computation.
calculateTaxAmounts(packages/server/src/modules/reports/helpers/tax.helper.ts) is shared by the tax report (step 13), the tax-expense charge (step 4) and SHAAM 6111 (step 16). A change there affects all three. - Ledger lock (step 8).
lockLedgerRecordssetsadmin_context.ledger_lockand marks ledger recordslocked.
Priority scale
| Grade | Meaning |
|---|---|
| P0 — Critical | Puts wrong numbers into the FY2025 statements or tax return in the common case. Fix before closing 2025, or apply the workaround. |
| P1 — High | Wrong in specific but realistic cases, or breaks a control the close relies on. Fix before filing. |
| P2 — Medium | Misleading output with a simple workaround. Fix in the next cycle. |
| P3 — Low | Polish. |
Effort: S is about a day, M is 2–4 days, L is 1–2 weeks.
Sub-issues
| Review item | Issue | Priority | Effort | FY2025 workaround |
|---|---|---|---|---|
| A2 | #5087 Vacation reserve is overstated, and decreases are booked as increases | P0 | M | Compute the reserve from the December payslips and book the correct change manually |
| A1 | #5086 Tax-expense charge books a loss year's negative tax as an expense | P1 (P0 if FY2025 is a tax-loss year) | S–M | In a loss year, don't generate the tax-expense charge (or delete it) and record tax 0 |
| A3 | #5088 Sort code 931 goes through both the R&D §20A adjustment and the reserves add-back | P1 | S | Correct the 2025 taxable income by −⅔·X₂₀₂₅ + ⅓·X₂₀₂₄ + ⅓·X₂₀₂₃ |
| A4 | #5090 Ledger lock: year-end charges still post into a locked year; locked records can't be reopened | P1 | M–L | Don't lock until the auditor's adjustments and the tax true-up are posted |
| A5 | #5091 SHAAM 6111: hard-coded header; tax-adjustment lines never filled | P1 (tasks P1–P3) | L | Use the app's file as a draft; finish it in the CPA's software or the Tax Authority's online form |
| A6 | #5092 Step 10 exports the year's movements instead of a year-end trial balance | P2 | M | Export the trial balance from inception to 31/12/2025 |
In the workaround for #5088, X is the sort-code-931 amount for each year.
Suggested order
- The numbers: #5087, #5086 and #5088.
- #5086 and #5088 both change
calculateTaxAmountsand the tax-expense generator. Land them in sequence, or in one PR. - Regenerate the tax expense after #5087, because the reserves change profit before tax.
- #5086 and #5088 both change
- The lock: #5090, before anyone locks FY2025.
- 6111 content: #5091, after #5086 and #5088, which feed lines 5600, 9980, 150 and 400.
- Trial balance export: #5092.
Definition of done
- All sub-issues closed.
- FY2025 year-end charges regenerated (steps 2 and 7 show no pending ledger changes) and re-approved.
- The FY2025 close review doc updated.
Related
- #5083: the 1214 package in the workflow (steps 6 and 18).
- #4544: dynamic report approvals in the annual audit flow.
- #1981, #1883, #1844: earlier ledger-lock issues; see #5090.
- #1147: partial-tax recognition. A tax-computation gap, not in this epic.
- Dominant language
- TypeScript
- Stars
- 30
- Forks
- 10
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 276
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Urigo/accounter-fullstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Urigo/accounter-fullstack#5302 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Urigo/accounter-fullstack#5257 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#5256 ·
Maintainers usually reply within 2 days
-
annual-audit-workflow
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Urigo/accounter-fullstack#5252 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#4919 ·
Maintainers usually reply within 2 days
All issues in Urigo/accounter-fullstack
Similar issues
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day