63e3a02212
renderInvoiceEInvoice()/renderCorrectionInvoiceEInvoice() produce a Factur-X-EN16931 hybrid PDF/A-3 (existing @react-pdf/renderer PDF + embedded EN16931 XML) via @e-invoice-eu/core, instead of a plain PDF. The plain renderInvoicePdf()/renderCorrectionInvoicePdf() stay unchanged and are still what Live Preview uses — this only adds a post-processing step for the actual send/download paths. buildEInvoiceData()/buildCorrectionEInvoiceData() map InvoiceOrder/ CorrectionInvoiceOrder + InvoiceSeller into the library's raw UBL-shaped Invoice object, reusing computeTaxBreakdown() for the tax math — one implementation feeding both the human-readable and machine-readable side of the same document. Verified end-to-end: rendered a sample invoice and correction invoice, inflated the embedded XML stream out of the resulting PDF/A-3 by hand (the library has no attachment-reading API to check against), confirmed correct CrossIndustryInvoice XML, EN16931 guideline reference, per-rate tax breakdown matching the order totals exactly, and payment means with the IBAN from Phase 2 — not just "it didn't throw." Found only through actually running it (not documented anywhere): every EN16931 amount field requires a sibling `*@currencyID` key via the library's runtime ajv validation, invisible in its TypeScript types. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
31 lines
866 B
JSON
31 lines
866 B
JSON
{
|
|
"name": "@einfach-produktiv/invoicing",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"description": "Shared invoice / correction-invoice (Stornorechnung, Gutschrift) PDF generation and VAT-breakdown math, consumed as a git dependency by both the einfach-produktiv frontend and the payload backend — not published to npm.",
|
|
"type": "module",
|
|
"main": "./src/index.ts",
|
|
"types": "./src/index.ts",
|
|
"scripts": {
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run",
|
|
"lint": "eslint ."
|
|
},
|
|
"peerDependencies": {
|
|
"@react-pdf/renderer": "^4.0.0",
|
|
"react": "^19.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@react-pdf/renderer": "^4.5.1",
|
|
"@types/node": "^20",
|
|
"@types/react": "^19",
|
|
"eslint": "^9",
|
|
"react": "^19.2.4",
|
|
"typescript": "^5",
|
|
"vitest": "^4.1.10"
|
|
},
|
|
"dependencies": {
|
|
"@e-invoice-eu/core": "^3.1.1"
|
|
}
|
|
}
|