Browse Source
Bugfix/dividend values in base currency (#7633)
* Fix missing currency conversion of dividends
* Update changelog
pull/7634/head^2
Thomas Kaul
3 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
8 additions and
11 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/portfolio.controller.ts
-
apps/api/src/app/portfolio/portfolio.service.ts
|
|
|
@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
- Extended the `GET api/v1/access` endpoint by the scopes |
|
|
|
- Extended the `GET api/v1/user` endpoint by the scopes |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed the missing currency conversion of the dividends on the analysis page |
|
|
|
|
|
|
|
## 3.51.0 - 2026-08-14 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
@ -352,8 +352,7 @@ export class PortfolioController { |
|
|
|
|
|
|
|
let dividends = this.portfolioService.getDividends({ |
|
|
|
activities, |
|
|
|
groupBy, |
|
|
|
userCurrency |
|
|
|
groupBy |
|
|
|
}); |
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
@ -358,21 +358,15 @@ export class PortfolioService { |
|
|
|
|
|
|
|
public getDividends({ |
|
|
|
activities, |
|
|
|
groupBy, |
|
|
|
userCurrency |
|
|
|
groupBy |
|
|
|
}: { |
|
|
|
activities: Activity[]; |
|
|
|
groupBy?: GroupBy; |
|
|
|
userCurrency: string; |
|
|
|
}): InvestmentItem[] { |
|
|
|
let dividends = activities.map(({ currency, date, value }) => { |
|
|
|
let dividends = activities.map(({ date, valueInBaseCurrency }) => { |
|
|
|
return { |
|
|
|
date: format(date, DATE_FORMAT), |
|
|
|
investment: this.exchangeRateDataService.toCurrency( |
|
|
|
value, |
|
|
|
currency, |
|
|
|
userCurrency |
|
|
|
) |
|
|
|
investment: valueInBaseCurrency |
|
|
|
}; |
|
|
|
}); |
|
|
|
|
|
|
|
|