| 
						
						
							
								
							
						
						
					 | 
					@ -2,6 +2,7 @@ import { CreateAccountBalanceDto } from '@ghostfolio/api/app/account-balance/cre | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { Activity } from '@ghostfolio/api/app/order/interfaces/activities.interface'; | 
					 | 
					 | 
					import { Activity } from '@ghostfolio/api/app/order/interfaces/activities.interface'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					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_6_FIGURES } from '@ghostfolio/common/config'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; | 
					 | 
					 | 
					import { DATE_FORMAT, downloadAsFile } from '@ghostfolio/common/helper'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { | 
					 | 
					 | 
					import { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  AccountBalancesResponse, | 
					 | 
					 | 
					  AccountBalancesResponse, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -51,9 +52,11 @@ export class AccountDetailDialog implements OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public accountBalances: AccountBalancesResponse['balances']; | 
					 | 
					 | 
					  public accountBalances: AccountBalancesResponse['balances']; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public activities: OrderWithAccount[]; | 
					 | 
					 | 
					  public activities: OrderWithAccount[]; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public balance: number; | 
					 | 
					 | 
					  public balance: number; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  public balancePrecision = 2; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public currency: string; | 
					 | 
					 | 
					  public currency: string; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public dataSource: MatTableDataSource<Activity>; | 
					 | 
					 | 
					  public dataSource: MatTableDataSource<Activity>; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public equity: number; | 
					 | 
					 | 
					  public equity: number; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  public equityPrecision = 2; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public hasPermissionToDeleteAccountBalance: boolean; | 
					 | 
					 | 
					  public hasPermissionToDeleteAccountBalance: boolean; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public historicalDataItems: HistoricalDataItem[]; | 
					 | 
					 | 
					  public historicalDataItems: HistoricalDataItem[]; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public holdings: PortfolioPosition[]; | 
					 | 
					 | 
					  public holdings: PortfolioPosition[]; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -188,10 +191,25 @@ export class AccountDetailDialog implements OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          valueInBaseCurrency | 
					 | 
					 | 
					          valueInBaseCurrency | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }) => { | 
					 | 
					 | 
					        }) => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.balance = balance; | 
					 | 
					 | 
					          this.balance = balance; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          if ( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.balance >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES && | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.data.deviceType === 'mobile' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          ) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.balancePrecision = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					          } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.currency = currency; | 
					 | 
					 | 
					          this.currency = currency; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          if (isNumber(balance) && isNumber(value)) { | 
					 | 
					 | 
					          if (isNumber(balance) && isNumber(value)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.equity = new Big(value).minus(balance).toNumber(); | 
					 | 
					 | 
					            this.equity = new Big(value).minus(balance).toNumber(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if ( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					              this.data.deviceType === 'mobile' && | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					              this.equity >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            ) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					              this.equityPrecision = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          } else { | 
					 | 
					 | 
					          } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.equity = null; | 
					 | 
					 | 
					            this.equity = null; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          } | 
					 | 
					 | 
					          } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |