fix(accounting): tax report degrades gracefully if cost side fails (+ surface the error)

The cost side is supplementary — it must never 500 the core revenue report.
getTaxReport now wraps loadCosts in try/catch: on failure it returns empty
costs + a costsError string and logs the real error. The tax page shows the
revenue report plus a non-fatal amber banner with the cost-side error message,
so the actual cause is visible in the UI instead of an opaque 500.
This commit is contained in:
Luca
2026-06-12 17:43:42 +02:00
parent ea8f6bc88a
commit 9f8511114a
3 changed files with 31 additions and 4 deletions
@@ -97,6 +97,8 @@ export interface TaxReport {
/** Cost side (#4). Present when the accounting tables exist; empty
* otherwise. */
costs: TaxReportCosts;
/** Non-fatal: set when the cost side failed to load (revenue still shown). */
costsError?: string | null;
/** Income/cost/result summary (#4). */
summary: TaxReportSummary;
currency: string;