|
@ -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 = |
|
|