Invoice generator shows a subtotal of -$0.00 when the line items cancel out
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
In the invoice generator, add three line items with tax at 0: "Website build" 1200.00, "Deposit received" -1000.10 and "Credit" -199.90. the subtotal shows "-$0.00", while tax and total show "$0.00". In floating point the sum is about -2.8e-14, and roundTo (lib/invoice-types.ts, lines 82 to 93) turns that into -0: it rounds the absolute value to 0 and then multiplies by the sign (line 92). Intl.NumberFormat prints -0 as "-$0.00", in the preview (InvoicePreview.tsx, line 118) and in the PDF (lib/invoice-pdf.ts, line 263).
What to do
- Make
roundToreturn0instead of-0, so every caller gets the fix.
Where to look
lib/invoice-types.ts:roundTo(lines 82 to 93) andcomputeTotals(lines 95 to 107)lib/__tests__/invoice-types.test.ts
Acceptance criteria
- The example above shows a subtotal of "$0.00"
- A real negative amount (a -200.00 line on its own) still shows its minus sign
- Tests that fail on the current code
-
npm run lint,npm run testandnpm run buildpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #315 in the description.
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 9
- 平均マージ
- 7時間 34分
- マージ済み PR(30日)
- 146
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/toolbelt のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Cron explainer says "on weekdays" for `0 0 1-31 * 1-5`, but the next runs include weekends対応中かも @Saifjafri212213 が今日担当しました。 オープンbug hacktoberfest help wanted
codercops/toolbelt#329 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
UUID generator's v7 batch comes out in random order instead of time order対応中かも @omisha123 が今日担当しました。 オープンbug good first issue hacktoberfest
codercops/toolbelt#316 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
JSON formatter's "Did you mean" hint reads inside strings, so a missing comma near a URL says to remove comments対応中かも @kachamsiddarth が今日担当しました。 オープンbug good first issue hacktoberfest
codercops/toolbelt#314 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Base64 decode error points at the wrong character when the input has spaces or line breaks対応中かも @Aaqibhafeezkhan が今日担当しました。 オープンbug good first issue hacktoberfest
codercops/toolbelt#310 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
codercops/toolbelt の issue をすべて見る
似ている issue
-
area:desktop bug documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
anthropics/claude-code#104801 ·
メンテナーはふだん 1 日以内に返信
-
check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
spudly/design-system#110 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: REST API URL starting with "http" but no scheme (e.g. httpbin.org/get) is not given an http:// prefix対応中かも @ItsDeadlyProgrammer が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
appsmithorg/appsmith#42471 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信