|
|
@ -78,31 +78,31 @@ import { AccountDetailDialogParams } from './interfaces/interfaces'; |
|
|
templateUrl: 'account-detail-dialog.html' |
|
|
templateUrl: 'account-detail-dialog.html' |
|
|
}) |
|
|
}) |
|
|
export class GfAccountDetailDialogComponent implements OnInit { |
|
|
export class GfAccountDetailDialogComponent implements OnInit { |
|
|
public accountBalances: AccountBalancesResponse['balances']; |
|
|
protected accountBalances: AccountBalancesResponse['balances']; |
|
|
public activities: OrderWithAccount[]; |
|
|
protected activities: OrderWithAccount[]; |
|
|
public activitiesCount: number; |
|
|
protected activitiesCount: number; |
|
|
public balance: number; |
|
|
protected balance: number; |
|
|
public balancePrecision = 2; |
|
|
protected balancePrecision = 2; |
|
|
public currency: string | null; |
|
|
protected currency: string | null; |
|
|
public dataSource: MatTableDataSource<Activity>; |
|
|
protected dataSource: MatTableDataSource<Activity>; |
|
|
public dividendInBaseCurrency: number; |
|
|
protected dividendInBaseCurrency: number; |
|
|
public dividendInBaseCurrencyPrecision = 2; |
|
|
protected dividendInBaseCurrencyPrecision = 2; |
|
|
public equity: number | null; |
|
|
protected equity: number | null; |
|
|
public equityPrecision = 2; |
|
|
protected equityPrecision = 2; |
|
|
public hasPermissionToDeleteAccountBalance: boolean; |
|
|
protected hasPermissionToDeleteAccountBalance: boolean; |
|
|
public historicalDataItems: HistoricalDataItem[]; |
|
|
protected historicalDataItems: HistoricalDataItem[]; |
|
|
public holdings: PortfolioPosition[]; |
|
|
protected holdings: PortfolioPosition[]; |
|
|
public interestInBaseCurrency: number; |
|
|
protected interestInBaseCurrency: number; |
|
|
public interestInBaseCurrencyPrecision = 2; |
|
|
protected interestInBaseCurrencyPrecision = 2; |
|
|
public isLoadingActivities: boolean; |
|
|
protected isLoadingActivities: boolean; |
|
|
public isLoadingChart: boolean; |
|
|
protected isLoadingChart: boolean; |
|
|
public name: string | null; |
|
|
protected name: string | null; |
|
|
public platformName: string; |
|
|
protected platformName: string; |
|
|
public sortColumn = 'date'; |
|
|
protected sortColumn = 'date'; |
|
|
public sortDirection: SortDirection = 'desc'; |
|
|
protected sortDirection: SortDirection = 'desc'; |
|
|
public totalItems: number; |
|
|
protected totalItems: number; |
|
|
public user: User; |
|
|
protected user: User; |
|
|
public valueInBaseCurrency: number; |
|
|
protected valueInBaseCurrency: number; |
|
|
|
|
|
|
|
|
private readonly changeDetectorRef = inject(ChangeDetectorRef); |
|
|
private readonly changeDetectorRef = inject(ChangeDetectorRef); |
|
|
private readonly data = inject<AccountDetailDialogParams>(MAT_DIALOG_DATA); |
|
|
private readonly data = inject<AccountDetailDialogParams>(MAT_DIALOG_DATA); |
|
|
@ -136,7 +136,7 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
this.initialize(); |
|
|
this.initialize(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onCloneActivity(aActivity: Activity) { |
|
|
protected onCloneActivity(aActivity: Activity) { |
|
|
this.router.navigate( |
|
|
this.router.navigate( |
|
|
internalRoutes.portfolio.subRoutes.activities.routerLink, |
|
|
internalRoutes.portfolio.subRoutes.activities.routerLink, |
|
|
{ |
|
|
{ |
|
|
@ -147,11 +147,11 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
this.dialogRef.close(); |
|
|
this.dialogRef.close(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onClose() { |
|
|
protected onClose() { |
|
|
this.dialogRef.close(); |
|
|
this.dialogRef.close(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onAddAccountBalance(accountBalance: CreateAccountBalanceDto) { |
|
|
protected onAddAccountBalance(accountBalance: CreateAccountBalanceDto) { |
|
|
this.dataService |
|
|
this.dataService |
|
|
.postAccountBalance(accountBalance) |
|
|
.postAccountBalance(accountBalance) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
@ -160,7 +160,7 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onDeleteAccountBalance(aId: string) { |
|
|
protected onDeleteAccountBalance(aId: string) { |
|
|
this.dataService |
|
|
this.dataService |
|
|
.deleteAccountBalance(aId) |
|
|
.deleteAccountBalance(aId) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
@ -169,7 +169,7 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onExport() { |
|
|
protected onExport() { |
|
|
const activityIds = this.dataSource.data.map(({ id }) => { |
|
|
const activityIds = this.dataSource.data.map(({ id }) => { |
|
|
return id; |
|
|
return id; |
|
|
}); |
|
|
}); |
|
|
@ -191,14 +191,14 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onSortChanged({ active, direction }: Sort) { |
|
|
protected onSortChanged({ active, direction }: Sort) { |
|
|
this.sortColumn = active; |
|
|
this.sortColumn = active; |
|
|
this.sortDirection = direction; |
|
|
this.sortDirection = direction; |
|
|
|
|
|
|
|
|
this.fetchActivities(); |
|
|
this.fetchActivities(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public onUpdateActivity(aActivity: Activity) { |
|
|
protected onUpdateActivity(aActivity: Activity) { |
|
|
this.router.navigate( |
|
|
this.router.navigate( |
|
|
internalRoutes.portfolio.subRoutes.activities.routerLink, |
|
|
internalRoutes.portfolio.subRoutes.activities.routerLink, |
|
|
{ |
|
|
{ |
|
|
@ -209,7 +209,7 @@ export class GfAccountDetailDialogComponent implements OnInit { |
|
|
this.dialogRef.close(); |
|
|
this.dialogRef.close(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public showValuesInPercentage() { |
|
|
protected showValuesInPercentage() { |
|
|
return ( |
|
|
return ( |
|
|
this.data.hasImpersonationId || this.user?.settings?.isRestrictedView |
|
|
this.data.hasImpersonationId || this.user?.settings?.isRestrictedView |
|
|
); |
|
|
); |
|
|
|