Shareholder T&S credit: taxable / max-taxable look swapped; a shareholder at the cap gets a 0-amount expense
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 30
- フォーク
- 10
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 276
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Urigo/accounter-fullstack のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
Urigo/accounter-fullstack#5302 ·
メンテナーはふだん 2 日以内に返信
-
1214 annual-audit-workflow
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Urigo/accounter-fullstack#5257 ·
メンテナーはふだん 2 日以内に返信
-
1214 annual-audit-workflow
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Urigo/accounter-fullstack#5256 ·
メンテナーはふだん 2 日以内に返信
-
annual-audit-workflow
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
Urigo/accounter-fullstack#5252 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Urigo/accounter-fullstack#4919 ·
メンテナーはふだん 2 日以内に返信
Urigo/accounter-fullstack の issue をすべて見る
似ている issue
-
area: integrations documentation priority: P2 size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
eddiejaoude/StackDash#798 ·
メンテナーはふだん 1 日以内に返信
-
bot:ai-assisted component:midnight-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
midnightntwrk/midnight-js#1790 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area:vscode bug has repro platform:macos platform:vscode regression
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信