|
@ -3,7 +3,11 @@ import { GfDialogFooterModule } from '@ghostfolio/client/components/dialog-foote |
|
|
import { GfDialogHeaderModule } from '@ghostfolio/client/components/dialog-header/dialog-header.module'; |
|
|
import { GfDialogHeaderModule } from '@ghostfolio/client/components/dialog-header/dialog-header.module'; |
|
|
import { DataService } from '@ghostfolio/client/services/data.service'; |
|
|
import { DataService } from '@ghostfolio/client/services/data.service'; |
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
import { NUMERICAL_PRECISION_THRESHOLD } from '@ghostfolio/common/config'; |
|
|
import { |
|
|
|
|
|
NUMERICAL_PRECISION_THRESHOLD_3_FIGURES, |
|
|
|
|
|
NUMERICAL_PRECISION_THRESHOLD_5_FIGURES, |
|
|
|
|
|
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
|
|
|
} from '@ghostfolio/common/config'; |
|
|
import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; |
|
|
import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; |
|
|
import { |
|
|
import { |
|
|
DataProviderInfo, |
|
|
DataProviderInfo, |
|
@ -101,6 +105,7 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { |
|
|
public assetClass: string; |
|
|
public assetClass: string; |
|
|
public assetSubClass: string; |
|
|
public assetSubClass: string; |
|
|
public averagePrice: number; |
|
|
public averagePrice: number; |
|
|
|
|
|
public averagePricePrecision = 2; |
|
|
public benchmarkDataItems: LineChartItem[]; |
|
|
public benchmarkDataItems: LineChartItem[]; |
|
|
public benchmarkLabel = $localize`Average Unit Price`; |
|
|
public benchmarkLabel = $localize`Average Unit Price`; |
|
|
public countries: { |
|
|
public countries: { |
|
@ -122,11 +127,15 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { |
|
|
public marketDataItems: MarketData[] = []; |
|
|
public marketDataItems: MarketData[] = []; |
|
|
public marketPrice: number; |
|
|
public marketPrice: number; |
|
|
public marketPriceMax: number; |
|
|
public marketPriceMax: number; |
|
|
|
|
|
public marketPriceMaxPrecision = 2; |
|
|
public marketPriceMin: number; |
|
|
public marketPriceMin: number; |
|
|
|
|
|
public marketPriceMinPrecision = 2; |
|
|
|
|
|
public marketPricePrecision = 2; |
|
|
public netPerformance: number; |
|
|
public netPerformance: number; |
|
|
public netPerformancePrecision = 2; |
|
|
public netPerformancePrecision = 2; |
|
|
public netPerformancePercent: number; |
|
|
public netPerformancePercent: number; |
|
|
public netPerformancePercentWithCurrencyEffect: number; |
|
|
public netPerformancePercentWithCurrencyEffect: number; |
|
|
|
|
|
public netPerformancePercentWithCurrencyEffectPrecision = 2; |
|
|
public netPerformanceWithCurrencyEffect: number; |
|
|
public netPerformanceWithCurrencyEffect: number; |
|
|
public netPerformanceWithCurrencyEffectPrecision = 2; |
|
|
public netPerformanceWithCurrencyEffectPrecision = 2; |
|
|
public quantity: number; |
|
|
public quantity: number; |
|
@ -274,6 +283,14 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { |
|
|
value |
|
|
value |
|
|
}) => { |
|
|
}) => { |
|
|
this.averagePrice = averagePrice; |
|
|
this.averagePrice = averagePrice; |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
this.data.deviceType === 'mobile' && |
|
|
|
|
|
this.averagePrice >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
|
|
|
) { |
|
|
|
|
|
this.averagePricePrecision = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.benchmarkDataItems = []; |
|
|
this.benchmarkDataItems = []; |
|
|
this.countries = {}; |
|
|
this.countries = {}; |
|
|
this.dataProviderInfo = dataProviderInfo; |
|
|
this.dataProviderInfo = dataProviderInfo; |
|
@ -281,7 +298,8 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { |
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
|
this.data.deviceType === 'mobile' && |
|
|
this.data.deviceType === 'mobile' && |
|
|
this.dividendInBaseCurrency >= NUMERICAL_PRECISION_THRESHOLD |
|
|
this.dividendInBaseCurrency >= |
|
|
|
|
|
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
) { |
|
|
) { |
|
|
this.dividendInBaseCurrencyPrecision = 0; |
|
|
this.dividendInBaseCurrencyPrecision = 0; |
|
|
} |
|
|
} |
|
@ -320,19 +338,42 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { |
|
|
if ( |
|
|
if ( |
|
|
this.data.deviceType === 'mobile' && |
|
|
this.data.deviceType === 'mobile' && |
|
|
this.investmentInBaseCurrencyWithCurrencyEffect >= |
|
|
this.investmentInBaseCurrencyWithCurrencyEffect >= |
|
|
NUMERICAL_PRECISION_THRESHOLD |
|
|
NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
) { |
|
|
) { |
|
|
this.investmentInBaseCurrencyWithCurrencyEffectPrecision = 0; |
|
|
this.investmentInBaseCurrencyWithCurrencyEffectPrecision = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.marketPrice = marketPrice; |
|
|
this.marketPrice = marketPrice; |
|
|
this.marketPriceMax = marketPriceMax; |
|
|
this.marketPriceMax = marketPriceMax; |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
this.data.deviceType === 'mobile' && |
|
|
|
|
|
this.marketPriceMax >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
|
|
|
) { |
|
|
|
|
|
this.marketPriceMaxPrecision = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.marketPriceMin = marketPriceMin; |
|
|
this.marketPriceMin = marketPriceMin; |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
this.data.deviceType === 'mobile' && |
|
|
|
|
|
this.marketPriceMin >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
|
|
|
) { |
|
|
|
|
|
this.marketPriceMinPrecision = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
this.data.deviceType === 'mobile' && |
|
|
|
|
|
this.marketPrice >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
|
|
|
) { |
|
|
|
|
|
this.marketPricePrecision = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.netPerformance = netPerformance; |
|
|
this.netPerformance = netPerformance; |
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
|
this.data.deviceType === 'mobile' && |
|
|
this.data.deviceType === 'mobile' && |
|
|
this.netPerformance >= NUMERICAL_PRECISION_THRESHOLD |
|
|
this.netPerformance >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES |
|
|
) { |
|
|
) { |
|
|
this.netPerformancePrecision = 0; |
|
|
this.netPerformancePrecision = 0; |
|
|
} |
|
|
} |
|
@ -342,13 +383,21 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit { |
|
|
this.netPerformancePercentWithCurrencyEffect = |
|
|
this.netPerformancePercentWithCurrencyEffect = |
|
|
netPerformancePercentWithCurrencyEffect; |
|
|
netPerformancePercentWithCurrencyEffect; |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
this.data.deviceType === 'mobile' && |
|
|
|
|
|
this.netPerformancePercentWithCurrencyEffect >= |
|
|
|
|
|
NUMERICAL_PRECISION_THRESHOLD_3_FIGURES |
|
|
|
|
|
) { |
|
|
|
|
|
this.netPerformancePercentWithCurrencyEffectPrecision = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.netPerformanceWithCurrencyEffect = |
|
|
this.netPerformanceWithCurrencyEffect = |
|
|
netPerformanceWithCurrencyEffect; |
|
|
netPerformanceWithCurrencyEffect; |
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
|
this.data.deviceType === 'mobile' && |
|
|
this.data.deviceType === 'mobile' && |
|
|
this.netPerformanceWithCurrencyEffect >= |
|
|
this.netPerformanceWithCurrencyEffect >= |
|
|
NUMERICAL_PRECISION_THRESHOLD |
|
|
NUMERICAL_PRECISION_THRESHOLD_5_FIGURES |
|
|
) { |
|
|
) { |
|
|
this.netPerformanceWithCurrencyEffectPrecision = 0; |
|
|
this.netPerformanceWithCurrencyEffectPrecision = 0; |
|
|
} |
|
|
} |
|
|