From 4ee3d7ac3d3d8399f67c476b87373cacef8d7b43 Mon Sep 17 00:00:00 2001 From: Hugo Persson Date: Wed, 26 Jul 2023 21:45:45 +0200 Subject: [PATCH] fix(activities-table.component.ts): remove subtraction of activity value in base currency for 'SELL' and 'LIABILITY' types The subtraction of activity value in base currency for 'SELL' and 'LIABILITY' types was causing incorrect calculations. By returning null instead of subtracting the value, we ensure that the total value is not affected by these types of activities. --- libs/ui/src/lib/activities-table/activities-table.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ui/src/lib/activities-table/activities-table.component.ts b/libs/ui/src/lib/activities-table/activities-table.component.ts index 3fd2ae1fe..e7292dbc7 100644 --- a/libs/ui/src/lib/activities-table/activities-table.component.ts +++ b/libs/ui/src/lib/activities-table/activities-table.component.ts @@ -390,7 +390,7 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy, OnInit { if (activity.type === 'BUY' || activity.type === 'ITEM') { totalValue = totalValue.plus(activity.valueInBaseCurrency); } else if (activity.type === 'SELL' || activity.type === 'LIABILITY') { - totalValue = totalValue.minus(activity.valueInBaseCurrency); + return null; } } else { return null;