Browse Source

Fix total buy calculation related to activities in custom currency

pull/5759/head
Thomas Kaul 2 weeks ago
parent
commit
1c3d54f24d
  1. 4
      apps/api/src/app/portfolio/portfolio.service.ts

4
apps/api/src/app/portfolio/portfolio.service.ts

@ -2126,11 +2126,11 @@ export class PortfolioService {
.filter(({ isDraft, type }) => {
return isDraft === false && type === activityType;
})
.map(({ quantity, SymbolProfile, unitPrice }) => {
.map(({ currency, quantity, SymbolProfile, unitPrice }) => {
return new Big(
this.exchangeRateDataService.toCurrency(
new Big(quantity).mul(unitPrice).toNumber(),
SymbolProfile.currency,
currency ?? SymbolProfile.currency,
userCurrency
)
);

Loading…
Cancel
Save