Skip to content

Conversation

@TkymHrt
Copy link
Member

@TkymHrt TkymHrt commented Jul 10, 2025

対応Issue

https://nut-m-e-g.slack.com/archives/C020WQ3GY07/p1752128119511159

概要

請求書PDF生成時に数量が反映されない問題を修正しました。

  • InvoiceSponsorStyle型にquantityunitPriceを追加しました。
  • AddBlankInvoiceModal.tsxinvoiceSponsorStyleに数量と単価を含めるように修正しました。
  • AddPdfDetailModal.tsxinvoiceSponsorStyleの数量と単価を正しく設定するように修正しました。
  • createSponsorActivitiesInvoicesPDF.tsxで数量と単価、金額を正しく表示するように修正しました。

画面スクリーンショット等

テスト項目

  • 請求書PDFが正しく生成され、数量が反映されていること。
  • AddBlankInvoiceModalから生成したPDFで、入力した数量が反映されていること。
  • AddPdfDetailModalから生成したPDFで、数量が1、単価が協賛スタイルの価格で表示されていること。

備考

AddPdfDetailModal.tsxにおける数量の扱いは、既存の協賛活動からPDFを生成する場合、数量はデフォルトで1
であり、単価は協賛スタイルの価格と一致するという仮定に基づいています。もし、協賛活動に数量の概念がある場合は、別途修正が必要です。

対応Issue: resolve #0 (仮)

概要:
請求書PDF生成時に数量が反映されない問題を修正しました。
- 型にとを追加しました。
- でに数量と単価を含めるように修正しました。
- での数量と単価を正しく設定するように修正しました。
- で数量と単価、金額を正しく表示するように修正しました。

テスト項目:
- 請求書PDFが正しく生成され、数量が反映されていること。
- から生成したPDFで、入力した数量が反映されていること。
- から生成したPDFで、数量が1、単価が協賛スタイルの価格で表示されていること。

備考:
における数量の扱いは、既存の協賛活動からPDFを生成する場合、数量はデフォルトで1であり、単価は協賛スタイルの価格と一致するという仮定に基づいています。もし、協賛活動に数量の概念がある場合は、別途修正が必要です。
@github-actions github-actions bot added the bug Something isn't working label Jul 10, 2025
@TkymHrt TkymHrt requested a review from Kubosaka July 10, 2025 07:47
@Kubosaka Kubosaka requested a review from Copilot July 10, 2025 08:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes missing quantity and unit price display in the generated invoice PDFs.

  • Extended the InvoiceSponsorStyle type with quantity and unitPrice
  • Populated these new fields in both blank‐invoice and existing‐activity modals
  • Updated the PDF generator to render quantity and unit price correctly

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
view/next-project/src/type/common.ts Added quantity and unitPrice fields to InvoiceSponsorStyle
view/next-project/src/components/sponsoractivities/AddBlankInvoiceModal.tsx Included quantity and unitPrice when mapping blank invoice lines
view/next-project/src/components/sponsoractivities/AddPdfDetailModal.tsx Set default quantity and unitPrice for existing sponsor styles
view/next-project/src/utils/createSponsorActivitiesInvoicesPDF.tsx Updated PDF table to display quantity, unitPrice, and total
Comments suppressed due to low confidence (2)

view/next-project/src/utils/createSponsorActivitiesInvoicesPDF.tsx:251

  • Add unit/integration tests to verify that the PDF generator correctly renders both the quantity and the unitPrice values in the invoice output.
                {sponsorStyle.quantity}

view/next-project/src/type/common.ts:306

  • [nitpick] Add JSDoc comments for the new quantity and unitPrice properties in InvoiceSponsorStyle to explain their purpose and usage.
  quantity: number;

const sponsorStyle = sponsorStyleDetail.sponsorStyle;
const res: InvoiceSponsorStyle = {
styleName: `${sponsorStyle.style}(${sponsorStyle.feature})`,
price: sponsorStyle.price,
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Include an inline comment clarifying the assumption that quantity is hardcoded to 1 when generating PDFs from existing sponsor activities.

Suggested change
price: sponsorStyle.price,
price: sponsorStyle.price,
// The quantity is hardcoded to 1 because each sponsor style is treated as a single unit in the current business logic.

Copilot uses AI. Check for mistakes.
@TkymHrt TkymHrt merged commit a8fc81b into develop Jul 26, 2025
@TkymHrt TkymHrt deleted the fix/yama/reflect-quantity-in-invoice-pdf branch July 26, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants