Tax computation: store the reserves sort code (931) in the admin context instead of hard-coding it
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 40/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- graphql, postgresql, react, typescript
Hướng nghiên cứu
Start at packages/server/src/modules/reports/helpers/tax.helper.ts, where RESERVES_SORT_CODE = 931 gates the add-back and the researchAndDevelopmentForTax / calculateCumulativeRnDExpenses exclusions, and read its existing tests. Then follow the securitiesContext.sortCode precedent: the user_context migration named in the issue, the admin context GraphQL type and update input, and admin-context/helpers/admin-context.helper.ts for the SortCodesProvider.getSortCodesByIdLoader validation. Done means the constant is gone, an unset setting applies no reserves treatment, and tests cover a non-931 code plus the unset case alongside the unchanged-931 path.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Priority: P3 — Low. Follow-up to #5088 / PR #5095. Part of #5085.
Effort: S · Area: server: admin-context, reports/helpers/tax.helper.ts; migrations; client admin settings
Problem
#5095 hard-codes the reserves sort code as RESERVES_SORT_CODE = 931 in packages/server/src/modules/reports/helpers/tax.helper.ts. It decides:
- which entities get the reserves add-back (6111 line 150);
- which R&D entities
researchAndDevelopmentForTaxkeeps out of the yearly R&D add-back and the §20A three-year spread (tax report, tax-expense charge, 6111).
Sort codes are per-tenant (accounter_schema.sort_codes is keyed by key + owner_id). A tenant that books reserves under another key gets reserves treated as R&D — the double adjustment #5088 fixed.
Proposal
Store the reserves sort code in the admin context, following the securitiesContext.sortCode precedent (user_context.securities_context, migration 2026-10-11T12-00-00.add-securities-context-to-user-context.ts):
- DB: add a nullable reserves sort-code setting to the admin context (
user_context). Migrate existing tenants to931, so behaviour doesn't change. - GraphQL: expose it on the admin context type and its update input. On update, validate it with
SortCodesProvider.getSortCodesByIdLoader, asadmin-context/helpers/admin-context.helper.tsdoes for the securities sort code. - Tax helper:
- read the value from
getVerifiedAdminContext()incalculateTaxAmounts; - pass it into
researchAndDevelopmentForTaxandcalculateCumulativeRnDExpenses(or resolve it in the callers: tax report, tax-expense ledger generator, 6111); - remove the constant;
- when the setting is unset, apply no reserves treatment (no add-back, no exclusion). Don't fall back to 931 silently.
- read the value from
- Client: add the field to the admin context settings screen.
Out of scope
The P&L section ranges (800/810, 920–931, 990–992, …) and the other tax sort codes (922, 945, 990, 991) are hard-coded too. Track them separately if wanted.
Acceptance criteria
- No hard-coded reserves code:
931no longer appears as a reserves constant in the tax computation. - Configured code drives the tax treatment: with the setting on another sort code, that code gets the reserves add-back and is kept out of the §20A spread, and 931 is treated as ordinary R&D.
- Existing tenants unchanged: after the migration, the tax report, the tax-expense charge and 6111 give the same results.
- Tests: the
tax.helpertests cover a non-931 configured code and the unset case.
- Ngôn ngữ chính
- TypeScript
- Star
- 30
- Fork
- 10
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 276
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Urigo/accounter-fullstack
-
Nested buttons from TooltipTrigger without asChildCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Urigo/accounter-fullstack#5302 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
1214 annual-audit-workflow
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Urigo/accounter-fullstack#5257 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
1214 annual-audit-workflow
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Urigo/accounter-fullstack#5256 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
annual-audit-workflow
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
Urigo/accounter-fullstack#5252 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Urigo/accounter-fullstack#4919 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của Urigo/accounter-fullstack
Issue tương tự
-
Media browser returns "Not found" for repositories using the SHA-256 object formatCó thể đã có người làm @adamchodera đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Follow-ups from #312Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
janhesters/remixcn#318 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
danielmiessler/LifeOS#3150 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Make the "%" unit spacing the same in the web and in A10Có thể đã có người làm @kragent66-glitch đã nhận hôm nay. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 bình luận ·