feat(accounting): scope the tax-report export to income-only or cost-only

Adds a Complete / Income only / Cost only selector to the readable PDF + CSV
export (the on-screen report stays complete). Income-only emits just the
outgoing rows + the income summary line (+ the per-rate breakdown in the PDF);
cost-only emits the incoming-invoice + expense rows + the cost line and drops
the income-by-rate breakdown. Useful in Liechtenstein where, under the income
threshold, a flat 20% Gewinnungskosten deduction is sometimes better than actual
costs — handing the Treuhänder just the income (or just the cost) basis is
cleaner.

Backend: renderTaxReportPdf/Csv take a `scope` param (all|income|cost) that
filters report.ledger by row.type + the summary lines; the /pdf + /csv routes
accept & validate `?scope=`; filenames get an income_/cost_ tag. Frontend:
scope <select> beside the export buttons, threaded through buildQueryString.
i18n en/de. The 20% calculation itself is intentionally NOT in-app (applied by
the Treuhänder) per the scoping decision.
This commit is contained in:
Luca
2026-06-16 18:51:11 +02:00
parent d6da89f48a
commit 9f3b28684f
6 changed files with 71 additions and 14 deletions
+4
View File
@@ -3953,6 +3953,10 @@
"export": {
"reportTitle": "Bericht",
"reportHint": "Lesbare Liste — für Ihre Unterlagen.",
"scopeLabel": "Export-Umfang",
"scopeAll": "Vollständig",
"scopeIncome": "Nur Einnahmen",
"scopeCost": "Nur Kosten",
"journalTitle": "Buchungsjournal"
},
"exportCsv": "CSV exportieren",
+4
View File
@@ -3953,6 +3953,10 @@
"export": {
"reportTitle": "Report",
"reportHint": "Readable list — for your own records.",
"scopeLabel": "Export scope",
"scopeAll": "Complete",
"scopeIncome": "Income only",
"scopeCost": "Cost only",
"journalTitle": "Accounting journal"
},
"exportCsv": "Export CSV",