From 94e38aca9c8199c635a571d21f51c5420393ad66 Mon Sep 17 00:00:00 2001 From: grabowski Date: Mon, 20 Apr 2026 13:11:13 +0700 Subject: [PATCH] Redesign overview: income vs expenses split with net-position card Hero row is now a two-column green/red split showing Income and Expenses side-by-side, with a full-width Net Position card below that colours green or red based on the sign. Budget KPIs (Remaining, Total, Allocated) moved to a secondary row underneath. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../(app)/companies/[companyId]/+page.svelte | 81 ++++++++++++------- 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/src/routes/(app)/companies/[companyId]/+page.svelte b/src/routes/(app)/companies/[companyId]/+page.svelte index 812103a..627abcf 100644 --- a/src/routes/(app)/companies/[companyId]/+page.svelte +++ b/src/routes/(app)/companies/[companyId]/+page.svelte @@ -11,6 +11,8 @@ const income = $derived(parseFloat(data.totalIncome ?? '0')); const remaining = $derived(total - spent); const remainingPct = $derived(total > 0 ? (remaining / total) * 100 : 0); + const net = $derived(income - spent); + const netPositive = $derived(net >= 0); const tone = $derived(remaining < 0 ? 'red' : remainingPct < 20 ? 'amber' : 'green'); @@ -36,11 +38,58 @@
- -
-
+ +
+
+
+

+ Income +

+ +
+

+ {formatCurrency(income, currency)} +

+

+ Net of withholding · from confirmed sales +

+
+ +
+
+

+ Expenses +

+ +
+

+ {formatCurrency(spent, currency)} +

+

+ Approved · across {data.projects.length} {data.projects.length === 1 ? 'project' : 'projects'} +

+
+ + +
+

+ Net Position (Income − Expenses) +

+

+ {netPositive ? '+' : ''}{formatCurrency(net, currency)} +

+
+
+ + +
+

- Remaining + Remaining Budget

{formatCurrency(remaining, currency)} @@ -63,19 +112,7 @@

{formatCurrency(total, currency)}

-

Company-wide

-
- -
-

- Spent -

-

- {formatCurrency(spent, currency)} -

-

- Across {data.projects.length} {data.projects.length === 1 ? 'project' : 'projects'} -

+

From account balances

@@ -89,16 +126,6 @@ {total > 0 ? ((allocated / total) * 100).toFixed(1) : '0'}% of total

- -
-

- Income (from confirmed sales) -

-

- {formatCurrency(income, currency)} -

-

Net of withholding tax

-