Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix total value of activities table (#680)

Thomas Kaul16f074335384
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7c83ca7347..ba39e1491a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed the horizontal overflow in the accounts table
- Fixed the horizontal overflow in the activities table
+- Fixed the total value of the activities table in the position detail dialog (absolute value)
### Todo
diff --git a/libs/ui/src/lib/activities-table/activities-table.component.html b/libs/ui/src/lib/activities-table/activities-table.component.html
index d7a880d719..5fd343a0a8 100644
--- a/libs/ui/src/lib/activities-table/activities-table.component.html
+++ b/libs/ui/src/lib/activities-table/activities-table.component.html
@@ -256,6 +256,7 @@
<td *matFooterCellDef class="px-1" mat-footer-cell>
<div class="d-flex justify-content-end">
<gf-value
+ [isAbsolute]="true"
[isCurrency]="true"
[locale]="locale"
[value]="isLoading ? undefined : totalValue"
diff --git a/libs/ui/src/lib/value/value.component.ts b/libs/ui/src/lib/value/value.component.ts
index 9c805e859e..07fc2b1363 100644
--- a/libs/ui/src/lib/value/value.component.ts
+++ b/libs/ui/src/lib/value/value.component.ts
@@ -17,6 +17,7 @@ import { isNumber } from 'lodash';
export class ValueComponent implements OnChanges {
@Input() colorizeSign = false;
@Input() currency = '';
+ @Input() isAbsolute = false;
@Input() isCurrency = false;
@Input() isPercent = false;
@Input() label = '';
@@ -91,6 +92,11 @@ export class ValueComponent implements OnChanges {
} else {
this.formattedValue = this.value?.toString();
}
+
+ if (this.isAbsolute) {
+ // Remove algebraic sign
+ this.formattedValue = this.formattedValue.replace(/^-/, '');
+ }
} else {
try {
if (isDate(new Date(this.value))) {