diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bfae57e7..de71fcf0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed a numeric parsing error related to cash positions on the _X-ray_ page - Fixed the total fee calculation in the holding detail dialog related to activities in a custom currency - Fixed the total fee calculation in the summary related to activities in a custom currency diff --git a/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts b/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts index 5caf09d7f..8fee1957c 100644 --- a/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts +++ b/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts @@ -429,9 +429,8 @@ export abstract class PortfolioCalculator { investment: totalInvestment, investmentWithCurrencyEffect: totalInvestmentWithCurrencyEffect, marketPrice: - marketSymbolMap[endDateString]?.[item.symbol]?.toNumber() ?? null, - marketPriceInBaseCurrency: - marketPriceInBaseCurrency?.toNumber() ?? null, + marketSymbolMap[endDateString]?.[item.symbol]?.toNumber() ?? 1, + marketPriceInBaseCurrency: marketPriceInBaseCurrency?.toNumber() ?? 1, netPerformance: !hasErrors ? (netPerformance ?? null) : null, netPerformancePercentage: !hasErrors ? (netPerformancePercentage ?? null) diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts index f5a4ca634..c9adebc44 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-cash.spec.ts @@ -247,7 +247,7 @@ describe('PortfolioCalculator', () => { includeInTotalAssetValue: false, investment: new Big(1820), investmentWithCurrencyEffect: new Big(1750), - marketPrice: null, + marketPrice: 1, marketPriceInBaseCurrency: 0.91, netPerformance: new Big(0), netPerformancePercentage: new Big(0), diff --git a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts index 4889ff316..3a00c022c 100644 --- a/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts +++ b/apps/api/src/app/portfolio/calculator/roai/portfolio-calculator-valuable.spec.ts @@ -130,7 +130,7 @@ describe('PortfolioCalculator', () => { grossPerformanceWithCurrencyEffect: new Big('0'), investment: new Big('500000'), investmentWithCurrencyEffect: new Big('500000'), - marketPrice: null, + marketPrice: 1, marketPriceInBaseCurrency: 500000, netPerformance: new Big('0'), netPerformancePercentage: new Big('0'),