Browse Source

Merge pull request #77 from dandevaud/bugfix/fix-total-current-value

Fix total current value calculation
pull/5027/head
dandevaud 1 year ago
committed by GitHub
parent
commit
0aebce990f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      apps/api/src/app/portfolio/portfolio-calculator.ts
  2. 4
      apps/api/src/app/portfolio/portfolio.service.ts

2
apps/api/src/app/portfolio/portfolio-calculator.ts

@ -1044,7 +1044,7 @@ export class PortfolioCalculator {
for (const currentPosition of positions) { for (const currentPosition of positions) {
if ( if (
currentPosition.investment && currentPosition.quantity &&
currentPosition.marketPriceInBaseCurrency currentPosition.marketPriceInBaseCurrency
) { ) {
currentValue = currentValue.plus( currentValue = currentValue.plus(

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

@ -1286,7 +1286,9 @@ export class PortfolioService {
filters, filters,
userId, userId,
withExcludedAccounts, withExcludedAccounts,
types: withItems ? ['BUY', 'ITEM', 'SELL'] : ['BUY', 'SELL'] types: withItems
? ['BUY', 'ITEM', 'STAKE', 'SELL']
: ['BUY', 'STAKE', 'SELL']
}); });
const portfolioCalculator = new PortfolioCalculator({ const portfolioCalculator = new PortfolioCalculator({

Loading…
Cancel
Save