Shareholder T&S credit: taxable / max-taxable look swapped; a shareholder at the cap gets a 0-amount expense
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Read packages/server/src/modules/business-trips/resolvers/credit-shareholders-business-trip-travel-and-subsistence.resolver.ts and trace how the summary row’s maxTaxableForeignCurrency and taxableForeignCurrency fields are defined and used. Check the related tests, then add coverage for the available amount calculation and a repeat run at the cap; done means the correct amount is distributed and no zero-amount expense or charge is created.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In packages/server/src/modules/business-trips/resolvers/credit-shareholders-business-trip-travel-and-subsistence.resolver.ts:
1. Possible swap (lines 121-124). The destructured names look reversed relative to the fields they read:
const [{ raw: taxableAmount }, { raw: maxTaxableAmount }] = await Promise.all([
travelAndSubsistenceRow.maxTaxableForeignCurrency,
travelAndSubsistenceRow.taxableForeignCurrency,
]);
const availableAmountToDistribute = Math.max(maxTaxableAmount - taxableAmount, 0);
If the fields mean what their names say, availableAmountToDistribute is taxable - maxTaxable. That is usually ≤ 0, so creditShareholdersBusinessTripTravelAndSubsistence credits nothing. It is the opposite only if the summary row's field names are themselves inverted. Confirm which way round is correct and fix whichever side is wrong.
2. 0-amount expenses at the cap (line 305). if (payedAmount > maxTaxableAmount) return; uses a strict >. A shareholder paid exactly up to the cap gets a potential of 0, and the final map still creates a travel-and-subsistence expense with amount: 0 for them, along with its charge. Running the mutation again after a full credit therefore adds a zero expense and charge per shareholder. Use >=, or filter out zero amounts before creating expenses.
Done when: the available amount is computed from the right fields, a repeated run after a full credit creates nothing, and a test covers both cases.
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