Browse Source

Merge pull request #147 from dandevaud/feature/Show-Tag-Allocation-in-PF-Allocation

Extract tag holding outside of Non-Cyrpto calculation
pull/5027/head
dandevaud 5 months ago
committed by GitHub
parent
commit
2a77e21ec7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 32
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

32
apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts

@ -346,6 +346,22 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
name: position.name
};
if (position.tags.length > 0) {
for (const tag of position.tags) {
const { name } = tag;
if (this.tagHoldingsMap[name]?.value) {
this.tagHoldingsMap[name].value +=
position.valueInBaseCurrency ?? 0;
} else {
this.tagHoldingsMap[name] = {
name,
value: position.valueInBaseCurrency ?? 0
};
}
}
}
if (position.assetClass !== AssetClass.LIQUIDITY) {
// Prepare analysis data by continents, countries, holdings and sectors except for liquidity
@ -423,22 +439,6 @@ export class AllocationsPageComponent implements OnDestroy, OnInit {
}
}
if (position.tags.length > 0) {
for (const tag of position.tags) {
const { name } = tag;
if (this.tagHoldingsMap[name]?.value) {
this.tagHoldingsMap[name].value +=
position.valueInBaseCurrency ?? 0;
} else {
this.tagHoldingsMap[name] = {
name,
value: position.valueInBaseCurrency ?? 0
};
}
}
}
if (position.sectors.length > 0) {
for (const sector of position.sectors) {
const { name, weight } = sector;

Loading…
Cancel
Save