Browse Source

Fix dividend calculation

pull/5335/head
Thomas Kaul 2 weeks ago
parent
commit
5849423e42
  1. 3
      apps/api/src/app/portfolio/portfolio.service.ts

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

@ -186,6 +186,7 @@ export class PortfolioService {
currency, currency,
date, date,
isDraft, isDraft,
quantity,
SymbolProfile, SymbolProfile,
type, type,
unitPrice unitPrice
@ -194,7 +195,7 @@ export class PortfolioService {
case ActivityType.DIVIDEND: case ActivityType.DIVIDEND:
dividendInBaseCurrency += dividendInBaseCurrency +=
await this.exchangeRateDataService.toCurrencyAtDate( await this.exchangeRateDataService.toCurrencyAtDate(
unitPrice, new Big(quantity).mul(unitPrice).toNumber(),
currency ?? SymbolProfile.currency, currency ?? SymbolProfile.currency,
userCurrency, userCurrency,
date date

Loading…
Cancel
Save