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

* Fix total value (absolute value)

* Update changelog
pull/681/head
Thomas Kaul 3 years ago committed by GitHub
parent 9b5ec0c56d
commit 16f0743353
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 accounts table
- Fixed the horizontal overflow in the activities 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 ### Todo

@ -256,6 +256,7 @@
<td *matFooterCellDef class="px-1" mat-footer-cell> <td *matFooterCellDef class="px-1" mat-footer-cell>
<div class="d-flex justify-content-end"> <div class="d-flex justify-content-end">
<gf-value <gf-value
[isAbsolute]="true"
[isCurrency]="true" [isCurrency]="true"
[locale]="locale" [locale]="locale"
[value]="isLoading ? undefined : totalValue" [value]="isLoading ? undefined : totalValue"

@ -17,6 +17,7 @@ import { isNumber } from 'lodash';
export class ValueComponent implements OnChanges { export class ValueComponent implements OnChanges {
@Input() colorizeSign = false; @Input() colorizeSign = false;
@Input() currency = ''; @Input() currency = '';
@Input() isAbsolute = false;
@Input() isCurrency = false; @Input() isCurrency = false;
@Input() isPercent = false; @Input() isPercent = false;
@Input() label = ''; @Input() label = '';
@ -91,6 +92,11 @@ export class ValueComponent implements OnChanges {
} else { } else {
this.formattedValue = this.value?.toString(); this.formattedValue = this.value?.toString();
} }
if (this.isAbsolute) {
// Remove algebraic sign
this.formattedValue = this.formattedValue.replace(/^-/, '');
}
} else { } else {
try { try {
if (isDate(new Date(this.value))) { if (isDate(new Date(this.value))) {

Loading…
Cancel
Save