Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/exclude cash position in base currency from holdings in overview (#8022)

Thomas Kaulc0aea2ac4aa9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 73f5227a41..6207c1c202 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved the label of the cash positions in the holdings charts and table
+- Excluded the cash position in the base currency from the holdings table on the overview tab of the home page (experimental)
- Extended the tools to get the activities, the portfolio and the watchlist in the server of the Model Context Protocol (MCP) to include the data source (experimental)
- Upgraded `@openrouter/ai-sdk-provider` from version `3.0.0` to `3.1.0`
- Upgraded `ai` from version `7.0.37` to `7.0.114`
diff --git a/apps/client/src/app/components/home-overview/home-overview.component.ts b/apps/client/src/app/components/home-overview/home-overview.component.ts
index 7715ef5719..b677f88a39 100644
--- a/apps/client/src/app/components/home-overview/home-overview.component.ts
+++ b/apps/client/src/app/components/home-overview/home-overview.component.ts
@@ -8,6 +8,7 @@ import {
DEFAULT_LOCALE,
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES
} from '@ghostfolio/common/config';
+import { isCashPosition } from '@ghostfolio/common/helper';
import {
AssetProfileIdentifier,
LineChartItem,
@@ -153,6 +154,8 @@ export class GfHomeOverviewComponent implements OnInit {
}
private update() {
+ const userSettings = this.user()?.settings;
+
this.historicalDataItems.set(null);
this.isLoadingPerformance.set(true);
@@ -162,17 +165,27 @@ export class GfHomeOverviewComponent implements OnInit {
this.dataService
.fetchPortfolioHoldings({
filters: [{ id: 'ACTIVE', type: 'HOLDING_TYPE' }],
- range: this.user()?.settings?.dateRange
+ range: userSettings?.dateRange
})
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ holdings }) => {
- this.holdings.set(holdings);
+ const baseCurrency = userSettings?.baseCurrency ?? DEFAULT_CURRENCY;
+
+ this.holdings.set(
+ holdings.filter(({ assetProfile }) => {
+ return !(
+ isCashPosition(assetProfile) &&
+ assetProfile.currency === baseCurrency &&
+ assetProfile.symbol === baseCurrency
+ );
+ })
+ );
});
}
this.dataService
.fetchPortfolioPerformance({
- range: this.user()?.settings?.dateRange ?? DEFAULT_DATE_RANGE
+ range: userSettings?.dateRange ?? DEFAULT_DATE_RANGE
})
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ chart, errors, performance }) => {