Browse Source

fix(activities-table.component.ts): subtract valueInBaseCurrency from totalValue when activity type is 'SELL' or 'LIABILITY' to calculate correct total value

pull/2184/head
Hugo Persson 2 years ago
parent
commit
771fb107ac
  1. 4
      libs/ui/src/lib/activities-table/activities-table.component.ts

4
libs/ui/src/lib/activities-table/activities-table.component.ts

@ -389,8 +389,8 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy, OnInit {
if (isNumber(activity.valueInBaseCurrency)) {
if (activity.type === 'BUY' || activity.type === 'ITEM') {
totalValue = totalValue.plus(activity.valueInBaseCurrency);
} else if (activity.type === 'SELL') {
return null;
} else if (activity.type === 'SELL' || activity.type === 'LIABILITY') {
totalValue = totalValue.minus(activity.valueInBaseCurrency);
}
} else {
return null;

Loading…
Cancel
Save