diff --git a/changelog.md b/changelog.md index 59034f6..58d4353 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-04-04 - 4.1.7 - fix(ZUGFeRD encoder & dependency) +Update @tsclass/tsclass dependency to ^8.2.0 and fix paymentOptions field in ZUGFeRD encoder for proper description output + +- Bump @tsclass/tsclass from ^8.1.1 to ^8.2.0 in package.json +- Replace invoice.paymentOptions.info with invoice.paymentOptions.description in ts/formats/cii/zugferd/zugferd.encoder.ts +- Update PDF metadata timestamps in test output + ## 2025-04-04 - 4.1.6 - fix(core) Improve PDF XML extraction, embedding, and format detection; update loadPdf/exportPdf error handling; add new validator implementations and enhance IPdf metadata. diff --git a/package.json b/package.json index 535a08c..2f62a94 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "dependencies": { "@push.rocks/smartfile": "^11.2.0", "@push.rocks/smartxml": "^1.1.1", - "@tsclass/tsclass": "^8.1.1", + "@tsclass/tsclass": "^8.2.0", "jsdom": "^26.0.0", "pako": "^2.1.0", "pdf-lib": "^1.17.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3ccdbf..49814da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^1.1.1 version: 1.1.1 '@tsclass/tsclass': - specifier: ^8.1.1 - version: 8.1.1 + specifier: ^8.2.0 + version: 8.2.0 jsdom: specifier: ^26.0.0 version: 26.0.0 @@ -1508,8 +1508,8 @@ packages: '@tsclass/tsclass@4.4.4': resolution: {integrity: sha512-YZOAF+u+r4u5rCev2uUd1KBTBdfyFdtDmcv4wuN+864lMccbdfRICR3SlJwCfYS1lbeV3QNLYGD30wjRXgvCJA==} - '@tsclass/tsclass@8.1.1': - resolution: {integrity: sha512-1hCqVj7uIpMfTw8aAiEyAiAhJ18WKRFT2JaHkXBk9dMtLaL0E6sLDxsEp7jjcMRpRvVBzt9aE8fguJth37phNg==} + '@tsclass/tsclass@8.2.0': + resolution: {integrity: sha512-qh3hhW5k030n3XVz6hDNrRPYZTTAvy7FZSnKYZXCRYV/JpNZw84daI4G4CgECOX/LAWAiW57MRwsFbShTddYBA==} '@types/accepts@1.3.7': resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==} @@ -7398,7 +7398,7 @@ snapshots: dependencies: type-fest: 4.37.0 - '@tsclass/tsclass@8.1.1': + '@tsclass/tsclass@8.2.0': dependencies: type-fest: 4.39.1 diff --git a/test/output/corpus-summary.md b/test/output/corpus-summary.md index 6276a59..09b584c 100644 --- a/test/output/corpus-summary.md +++ b/test/output/corpus-summary.md @@ -1,6 +1,6 @@ # XInvoice Corpus Testing Summary -Generated on: 2025-04-04T12:11:35.722Z +Generated on: 2025-04-04T13:08:19.930Z ## Overall Summary diff --git a/test/output/test-invoice-with-xml.pdf b/test/output/test-invoice-with-xml.pdf index 58392ac..b08f423 100644 Binary files a/test/output/test-invoice-with-xml.pdf and b/test/output/test-invoice-with-xml.pdf differ diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 08da188..9eb99e6 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@fin.cx/xinvoice', - version: '4.1.6', + version: '4.1.7', description: 'A TypeScript module for creating, manipulating, and embedding XML data within PDF files specifically tailored for xinvoice packages.' } diff --git a/ts/formats/cii/zugferd/zugferd.encoder.ts b/ts/formats/cii/zugferd/zugferd.encoder.ts index dd5c7da..958300d 100644 --- a/ts/formats/cii/zugferd/zugferd.encoder.ts +++ b/ts/formats/cii/zugferd/zugferd.encoder.ts @@ -370,7 +370,7 @@ export class ZUGFeRDEncoder extends CIIBaseEncoder { if (invoice.paymentOptions) { // Add payment instructions as description - this is generic enough to work with any payment type const descriptionElement = doc.createElement('ram:Description'); - descriptionElement.textContent = `Due in ${invoice.dueInDays} days. ${invoice.paymentOptions.info || ''}`; + descriptionElement.textContent = `Due in ${invoice.dueInDays} days. ${invoice.paymentOptions.description || ''}`; paymentTermsElement.appendChild(descriptionElement); } @@ -398,10 +398,10 @@ export class ZUGFeRDEncoder extends CIIBaseEncoder { typeCodeElement.textContent = '58'; paymentMeansElement.appendChild(typeCodeElement); - // Information (optional) - if (invoice.paymentOptions.info) { + // Description (optional) + if (invoice.paymentOptions.description) { const infoElement = doc.createElement('ram:Information'); - infoElement.textContent = invoice.paymentOptions.info; + infoElement.textContent = invoice.paymentOptions.description; paymentMeansElement.appendChild(infoElement); }