Bugfix/readd value in base currency to activity (#3078)

* Readd valueInBaseCurrency

* Update changelog
pull/3079/head^2
Thomas Kaul 10 months ago committed by GitHub
parent 8a49a04324
commit 7f67430685
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the usability of the benchmarks in the markets overview - Improved the usability of the benchmarks in the markets overview
### Fixed
- Fixed a missing value in the activities table on mobile
## 2.59.0 - 2024-02-29 ## 2.59.0 - 2024-02-29
### Added ### Added

@ -7,8 +7,10 @@ export interface Activities {
export interface Activity extends OrderWithAccount { export interface Activity extends OrderWithAccount {
error?: ActivityError; error?: ActivityError;
feeInBaseCurrency: number;
updateAccountBalance?: boolean; updateAccountBalance?: boolean;
value: number; value: number;
valueInBaseCurrency: number;
} }
export interface ActivityError { export interface ActivityError {

@ -328,7 +328,17 @@ export class OrderService {
return { return {
...order, ...order,
value value,
feeInBaseCurrency: this.exchangeRateDataService.toCurrency(
order.fee,
order.SymbolProfile.currency,
userCurrency
),
valueInBaseCurrency: this.exchangeRateDataService.toCurrency(
value,
order.SymbolProfile.currency,
userCurrency
)
}; };
}); });

@ -237,14 +237,10 @@ export class PortfolioService {
types: ['DIVIDEND'] types: ['DIVIDEND']
}); });
let dividends = activities.map(({ date, SymbolProfile, value }) => { let dividends = activities.map(({ date, valueInBaseCurrency }) => {
return { return {
date: format(date, DATE_FORMAT), date: format(date, DATE_FORMAT),
investment: this.exchangeRateDataService.toCurrency( investment: valueInBaseCurrency
value,
SymbolProfile.currency,
userCurrency
)
}; };
}); });
@ -768,14 +764,8 @@ export class PortfolioService {
.filter(({ type }) => { .filter(({ type }) => {
return type === 'DIVIDEND'; return type === 'DIVIDEND';
}) })
.map(({ SymbolProfile, value }) => { .map(({ valueInBaseCurrency }) => {
return new Big( return new Big(valueInBaseCurrency);
this.exchangeRateDataService.toCurrency(
value,
SymbolProfile.currency,
userCurrency
)
);
}) })
); );
@ -2105,15 +2095,11 @@ export class PortfolioService {
quantity, quantity,
SymbolProfile, SymbolProfile,
type, type,
unitPrice valueInBaseCurrency
} of ordersByAccount) { } of ordersByAccount) {
const unitPriceInBaseCurrency = const unitPriceInBaseCurrency =
portfolioItemsNow[SymbolProfile.symbol]?.marketPriceInBaseCurrency ?? portfolioItemsNow[SymbolProfile.symbol]?.marketPriceInBaseCurrency ??
this.exchangeRateDataService.toCurrency( valueInBaseCurrency ??
unitPrice,
SymbolProfile.currency,
userCurrency
) ??
0; 0;
let currentValueOfSymbolInBaseCurrency = let currentValueOfSymbolInBaseCurrency =

Loading…
Cancel
Save