Initial commit: shared invoice/correction-invoice PDF generation

Consolidates code previously hand-duplicated between the einfach-produktiv
frontend and payload backend repos into one canonical implementation,
consumed as a git dependency by both instead of being kept in sync by eye.

While merging the two correction-invoice copies, found and fixed three
real drifts between them:
- variantName was silently dropped in the backend's emailed Stornorechnung/
  Gutschrift, but present in the frontend's re-download copy
- the backend's correction-invoice footer wasn't position:fixed, unlike
  the original invoice and the frontend's copy
- the backend used a numeric date format (03.07.2025) while the original
  invoice and the frontend's copy both used a spelled-out month (03. Juli
  2025) — a re-download didn't visually match what was emailed

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Marco
2026-07-23 08:33:12 +00:00
commit 9336cfd0ba
13 changed files with 4180 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
{
"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": "^19.0.0",
"@react-pdf/renderer": "^4.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"
}
}