|
|
@ -130,7 +130,7 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
value: number; |
|
|
value: number; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
protected topHoldings: HoldingWithParents[]; |
|
|
protected topHoldings: HoldingWithParents[] | undefined; |
|
|
protected readonly UNKNOWN_KEY = UNKNOWN_KEY; |
|
|
protected readonly UNKNOWN_KEY = UNKNOWN_KEY; |
|
|
protected user: User; |
|
|
protected user: User; |
|
|
|
|
|
|
|
|
@ -360,6 +360,7 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
value: 0 |
|
|
value: 0 |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.topHoldings = undefined; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private initializeAllocationsData() { |
|
|
private initializeAllocationsData() { |
|
|
@ -387,7 +388,7 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
} = {}; |
|
|
} = {}; |
|
|
|
|
|
|
|
|
let totalValueExcludingCashPositions = 0; |
|
|
let totalValueExcludingCashPositions = 0; |
|
|
let totalValueInEtf = 0; |
|
|
let totalValueInFunds = 0; |
|
|
|
|
|
|
|
|
for (const position of this.portfolioDetails.holdings) { |
|
|
for (const position of this.portfolioDetails.holdings) { |
|
|
const assetProfileIdentifier = getAssetProfileIdentifier( |
|
|
const assetProfileIdentifier = getAssetProfileIdentifier( |
|
|
@ -463,6 +464,8 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (position.assetProfile.holdings.length > 0) { |
|
|
if (position.assetProfile.holdings.length > 0) { |
|
|
|
|
|
totalValueInFunds += this.holdings[assetProfileIdentifier].value; |
|
|
|
|
|
|
|
|
for (const { |
|
|
for (const { |
|
|
allocationInPercentage, |
|
|
allocationInPercentage, |
|
|
name, |
|
|
name, |
|
|
@ -513,10 +516,6 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.holdings[assetProfileIdentifier].assetSubClass === 'ETF') { |
|
|
|
|
|
totalValueInEtf += this.holdings[assetProfileIdentifier].value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const symbol = position.assetProfile.symbol; |
|
|
const symbol = position.assetProfile.symbol; |
|
|
|
|
|
|
|
|
const value = this.extractValue(position); |
|
|
const value = this.extractValue(position); |
|
|
@ -593,7 +592,7 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
return { |
|
|
return { |
|
|
name, |
|
|
name, |
|
|
allocationInPercentage: |
|
|
allocationInPercentage: |
|
|
totalValueInEtf > 0 ? value / totalValueInEtf : 0, |
|
|
totalValueInFunds > 0 ? value / totalValueInFunds : 0, |
|
|
parents: this.portfolioDetails.holdings |
|
|
parents: this.portfolioDetails.holdings |
|
|
.map((holding) => { |
|
|
.map((holding) => { |
|
|
if (holding.assetProfile.holdings.length > 0) { |
|
|
if (holding.assetProfile.holdings.length > 0) { |
|
|
@ -610,7 +609,9 @@ export class GfAllocationsPageComponent implements OnInit { |
|
|
isNumber(currentParentHolding.valueInBaseCurrency) |
|
|
isNumber(currentParentHolding.valueInBaseCurrency) |
|
|
? { |
|
|
? { |
|
|
allocationInPercentage: |
|
|
allocationInPercentage: |
|
|
currentParentHolding.valueInBaseCurrency / value, |
|
|
value > 0 |
|
|
|
|
|
? currentParentHolding.valueInBaseCurrency / value |
|
|
|
|
|
: 0, |
|
|
name: holding.assetProfile.name ?? '', |
|
|
name: holding.assetProfile.name ?? '', |
|
|
position: holding, |
|
|
position: holding, |
|
|
symbol: holding.assetProfile.symbol, |
|
|
symbol: holding.assetProfile.symbol, |
|
|
|