|
|
@ -1787,7 +1787,8 @@ export class PortfolioService { |
|
|
|
activityType: 'INTEREST' |
|
|
|
}).toNumber(); |
|
|
|
|
|
|
|
const items = Object.keys(holdings) |
|
|
|
const items = getSum( |
|
|
|
Object.keys(holdings) |
|
|
|
.filter((symbol) => { |
|
|
|
return ( |
|
|
|
isUUID(symbol) && |
|
|
@ -1796,15 +1797,12 @@ export class PortfolioService { |
|
|
|
); |
|
|
|
}) |
|
|
|
.map((symbol) => { |
|
|
|
return Math.abs(holdings[symbol].valueInBaseCurrency); |
|
|
|
return new Big(holdings[symbol].valueInBaseCurrency).abs(); |
|
|
|
}) |
|
|
|
.reduce( |
|
|
|
(previous, current) => new Big(previous).plus(current), |
|
|
|
new Big(0) |
|
|
|
) |
|
|
|
.toNumber(); |
|
|
|
).toNumber(); |
|
|
|
|
|
|
|
const liabilities = Object.keys(holdings) |
|
|
|
const liabilities = getSum( |
|
|
|
Object.keys(holdings) |
|
|
|
.filter((symbol) => { |
|
|
|
return ( |
|
|
|
isUUID(symbol) && |
|
|
@ -1813,13 +1811,9 @@ export class PortfolioService { |
|
|
|
); |
|
|
|
}) |
|
|
|
.map((symbol) => { |
|
|
|
return Math.abs(holdings[symbol].valueInBaseCurrency); |
|
|
|
return new Big(holdings[symbol].valueInBaseCurrency).abs(); |
|
|
|
}) |
|
|
|
.reduce( |
|
|
|
(previous, current) => new Big(previous).plus(current), |
|
|
|
new Big(0) |
|
|
|
) |
|
|
|
.toNumber(); |
|
|
|
).toNumber(); |
|
|
|
|
|
|
|
const totalBuy = this.getSumOfActivityType({ |
|
|
|
userCurrency, |
|
|
|