Bugfix/fix liability issue in allocations (#3133)

* Remove liabilities from allocations calculation

* Update changelog
pull/3130/head^2
Thomas Kaul 9 months ago committed by GitHub
parent 59c064e3c8
commit 7a364472c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed an issue in the performance calculation caused by multiple `SELL` activities on the same day
- Fixed an issue in the calculation on the allocations page caused by liabilities
## 2.62.0 - 2024-03-09

@ -76,8 +76,11 @@ export class PortfolioController {
@Query('accounts') filterByAccounts?: string,
@Query('assetClasses') filterByAssetClasses?: string,
@Query('range') dateRange: DateRange = 'max',
@Query('tags') filterByTags?: string
@Query('tags') filterByTags?: string,
@Query('withLiabilities') withLiabilitiesParam = 'false'
): Promise<PortfolioDetails & { hasError: boolean }> {
const withLiabilities = withLiabilitiesParam === 'true';
let hasDetails = true;
let hasError = false;
const hasReadRestrictedAccessPermission =
@ -101,8 +104,8 @@ export class PortfolioController {
dateRange,
filters,
impersonationId,
withLiabilities,
userId: this.request.user.id,
withLiabilities: true,
withSummary: true
});

@ -146,8 +146,7 @@ export class PortfolioService {
filters,
withExcludedAccounts,
impersonationId: userId,
userId: this.request.user.id,
withLiabilities: true
userId: this.request.user.id
})
]);
@ -393,6 +392,7 @@ export class PortfolioService {
});
const holdings: PortfolioDetails['holdings'] = {};
const totalValueInBaseCurrency =
currentPositions.currentValueInBaseCurrency.plus(
cashDetails.balanceInBaseCurrency

@ -102,7 +102,7 @@ export class HomeSummaryComponent implements OnDestroy, OnInit {
this.isLoading = true;
this.dataService
.fetchPortfolioDetails()
.fetchPortfolioDetails({ withLiabilities: true })
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(({ summary }) => {
this.summary = summary;

@ -390,13 +390,21 @@ export class DataService {
}
public fetchPortfolioDetails({
filters
filters,
withLiabilities = false
}: {
filters?: Filter[];
withLiabilities?: boolean;
} = {}): Observable<PortfolioDetails> {
let params = this.buildFiltersAsQueryParams({ filters });
if (withLiabilities) {
params = params.append('withLiabilities', withLiabilities);
}
return this.http
.get<any>('/api/v1/portfolio/details', {
params: this.buildFiltersAsQueryParams({ filters })
params
})
.pipe(
map((response) => {

Loading…
Cancel
Save