Browse Source
Bugfix/fix buying power calculation with emergency fund tag (#1713)
* Fix buying power calculation
* Update changelog
pull/1715/head^2
Thomas Kaul
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
8 additions and
1 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/portfolio.service.ts
|
|
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
- Beautified the ETF names in the asset profile |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed the buying power calculation if no emergency fund is set but an activity is tagged as _Emergency Fund_ |
|
|
|
|
|
|
|
## 1.235.0 - 2023-02-16 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
@ -1550,7 +1550,10 @@ export class PortfolioService { |
|
|
|
userCurrency |
|
|
|
}).toNumber(); |
|
|
|
const emergencyFund = new Big( |
|
|
|
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0 |
|
|
|
Math.max( |
|
|
|
emergencyFundPositionsValueInBaseCurrency, |
|
|
|
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0 |
|
|
|
) |
|
|
|
); |
|
|
|
const fees = this.getFees({ activities, userCurrency }).toNumber(); |
|
|
|
const firstOrderDate = activities[0]?.date; |
|
|
|