From 0eaf41d8d37c05320ca5d771b7b4d80469df2dec Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 28 Jul 2026 20:57:56 +0200 Subject: [PATCH] Improve portfolio summary --- .../holding-detail-dialog.html | 2 +- .../portfolio-summary.component.html | 44 +++++++++++++------ .../portfolio-summary.component.ts | 10 +++++ 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html index 0a8ee6dcea..30222de65e 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html @@ -170,7 +170,7 @@ " [unit]="data.baseCurrency" [value]="investmentInBaseCurrencyWithCurrencyEffect" - >InvestmentInvested Capital @if ( diff --git a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html index fd0ac9b72f..e4ff1ba938 100644 --- a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html +++ b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.html @@ -57,7 +57,7 @@

-
Investment
+
Invested Capital
- Cash + Holdings @if ( !hasImpersonationId && summary?.totalValueInBaseCurrency > 0 && @@ -175,7 +175,8 @@ class="d-lg-inline-block d-none ml-2 small text-muted" [isPercent]="true" [locale]="locale" - [value]="isLoading ? undefined : cashPercentage" + [precision]="0" + [value]="isLoading ? undefined : holdingsPercentage" /> }
@@ -187,13 +188,13 @@ [locale]="locale" [precision]="precision" [unit]="baseCurrency" - [value]="isLoading ? undefined : summary?.totalCashInBaseCurrency" + [value]="isLoading ? undefined : holdingsInBaseCurrency" />
- @if (isLoading || summary?.emergencyFund?.cash > 0) { + @if (isLoading || summary?.emergencyFund?.assets > 0) {
-
Buying Power
+
Investments
@@ -216,14 +217,14 @@ [locale]="locale" [precision]="precision" [unit]="baseCurrency" - [value]="isLoading ? undefined : summary?.emergencyFund?.cash" + [value]="isLoading ? undefined : summary?.emergencyFund?.assets" />
}
- Holdings + Cash @if ( !hasImpersonationId && summary?.totalValueInBaseCurrency > 0 && @@ -233,7 +234,8 @@ class="d-lg-inline-block d-none ml-2 small text-muted" [isPercent]="true" [locale]="locale" - [value]="isLoading ? undefined : holdingsPercentage" + [precision]="0" + [value]="isLoading ? undefined : cashPercentage" /> }
@@ -245,11 +247,25 @@ [locale]="locale" [precision]="precision" [unit]="baseCurrency" - [value]="isLoading ? undefined : holdingsInBaseCurrency" + [value]="isLoading ? undefined : summary?.totalCashInBaseCurrency" />
- @if (isLoading || summary?.emergencyFund?.assets > 0) { + @if (isLoading || summary?.emergencyFund?.cash > 0) { +
+
Buying Power
+
+ +
+
Emergency Fund
@@ -260,7 +276,7 @@ [locale]="locale" [precision]="precision" [unit]="baseCurrency" - [value]="isLoading ? undefined : summary?.emergencyFund?.assets" + [value]="isLoading ? undefined : summary?.emergencyFund?.cash" />
@@ -277,6 +293,7 @@ class="d-lg-inline-block d-none ml-2 small text-muted" [isPercent]="true" [locale]="locale" + [precision]="0" [value]="isLoading ? undefined : excludedFromAnalysisPercentage" /> } @@ -363,6 +380,7 @@ class="d-lg-inline-block d-none ml-2 small text-muted" [isPercent]="true" [locale]="locale" + [precision]="0" [value]="isLoading ? undefined : emergencyFundPercentage" /> } diff --git a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts index 1cd2ec93ca..eaf71210f1 100644 --- a/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts +++ b/apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts @@ -98,6 +98,16 @@ export class GfPortfolioSummaryComponent implements OnChanges { : 0; } + protected get investmentsInBaseCurrency() { + if (!isNumber(this.holdingsInBaseCurrency)) { + return null; + } + + return ( + this.holdingsInBaseCurrency - (this.summary.emergencyFund?.assets ?? 0) + ); + } + public ngOnChanges() { if (this.summary) { if (