Depreciation report: merge the on-screen table and form 1342 print data into one backend model
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend, frontend, full-stack
Hướng nghiên cứu
Read the depreciation report resolver and depreciation-form-1342.helper.ts, then trace the screen query and rendering in index.tsx and form-1342.tsx. Compare the existing server and client tests listed in the acceptance criteria. Done means printing fetches form1342 on demand, the screen and print view share row iteration, the two report PDFs match the specified outputs, and the listed checks pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
PR https://github.com/Urigo/accounter-fullstack/pull/5235 adds a print-only Hebrew replica of Tax Authority form 1342 for the depreciation report. It builds on https://github.com/Urigo/accounter-fullstack/pull/5233. The print view runs in parallel with the on-screen table, so the same report is rendered and fetched twice.
Current duplication
- Server (already one source).
DepreciationReportResult.form1342is a field resolver (packages/server/src/modules/reports/resolvers/depreciation-report.resolver.ts). It callsbuildForm1342(roundDepreciationReport(report), ...)on the same report thatcategoriescomes from, so nothing is recomputed. The model is built inpackages/server/src/modules/reports/helpers/depreciation-form-1342.helper.ts. That helper owns the Hebrew texts (FORM_1342_TEXTS), columns, instructions, notes key, and the category, asset and total row building (buildRows,assetRow,totalRow). - Client fetches twice.
packages/client/src/components/screens/reports/depreciation-report/index.tsxrequestscategoriesandform1342in the sameDepreciationReportScreenquery on every load.form1342is never shown on screen, so its payload and render are wasted on every page load. - Client renders twice. The screen rebuilds category headers, record rows, summary rows and the grand total (
index.tsx,depreciation-record-row.tsx,depreciation-summary-row.tsx).packages/client/src/components/screens/reports/depreciation-report/form-1342.tsx(441 lines) re-lays-out the same rows for print. The screen hides its table only withprint:hidden, so both trees stay mounted. - Labels in two places. Hebrew labels live in the client
i18n.ts(from #5232) and in the server'sFORM_1342_TEXTS.
Proposed work
- Backend owns the print model. Keep
buildForm1342as the single place that turns a report into printable rows. Keep the print labels only on the server, and remove client copies that exist only for print. - Fetch the print model only when printing. Move
form1342out ofDepreciationReportScreen. Fetch it with a separate urql query that stays paused until the print button is pressed. - Shared UI rows. Extract the category, asset and summary row iteration into one module used by both the screen table and the print view. The print view then only maps model rows to cells. The screen keeps its own columns, and the print view keeps the form's 11 columns.
- Label ownership. Decide which side owns each label set so the same wording is not kept twice.
Open questions
- Fetch the print model on click (recommended), or keep one combined query?
- Should the screen table also be built from the server's rows, or only share the client row helpers?
Acceptance criteria
- The report page loads without a
form1342request. Clicking print fetches it and prints the same form as #5235. - The PDF output matches the output from #5235 for the short and 40-asset reports.
- Server tests (
depreciation-form-1342.helper.test.ts,depreciation-report.resolver.test.ts) and clientform-1342.test.tsxpass. yarn generateandyarn lintpass.
Notes
Builds on #5233 and #5235. Merge after #5235.
Generated by Claude Code
- 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
-
Độ 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ự
-
area: integrations documentation priority: P2 size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
eddiejaoude/StackDash#798 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bot:ai-assisted component:midnight-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
midnightntwrk/midnight-js#1790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:vscode bug has repro platform:macos platform:vscode regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDĐang mởcheck:passed streams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày