Browse Source

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.
pull/2184/head
Hugo Persson 2 years ago
parent
commit
4ee3d7ac3d
  1. 2
      libs/ui/src/lib/activities-table/activities-table.component.ts

2
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') { if (activity.type === 'BUY' || activity.type === 'ITEM') {
totalValue = totalValue.plus(activity.valueInBaseCurrency); totalValue = totalValue.plus(activity.valueInBaseCurrency);
} else if (activity.type === 'SELL' || activity.type === 'LIABILITY') { } else if (activity.type === 'SELL' || activity.type === 'LIABILITY') {
totalValue = totalValue.minus(activity.valueInBaseCurrency); return null;
} }
} else { } else {
return null; return null;

Loading…
Cancel
Save