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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
2 deletions
-
apps/api/src/app/portfolio/portfolio-calculator.ts
-
apps/api/src/app/portfolio/portfolio.service.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( |
|
|
|
@ -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({ |
|
|