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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user