|
@ -462,16 +462,16 @@ export class PortfolioService { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const holdings: PortfolioDetails['holdings'] = {}; |
|
|
const holdings: PortfolioDetails['holdings'] = {}; |
|
|
const totalInvestmentInBaseCurrency = currentPositions.currentValue.plus( |
|
|
const totalValueInBaseCurrency = currentPositions.currentValue.plus( |
|
|
cashDetails.balanceInBaseCurrency |
|
|
cashDetails.balanceInBaseCurrency |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const isFilteredByAccount = filters.some( |
|
|
const isFilteredByAccount = filters.some((filter) => { |
|
|
(filter) => filter.type === 'ACCOUNT' |
|
|
return filter.type === 'ACCOUNT'; |
|
|
); |
|
|
}); |
|
|
|
|
|
|
|
|
let filteredValueInBaseCurrency = isFilteredByAccount |
|
|
let filteredValueInBaseCurrency = isFilteredByAccount |
|
|
? totalInvestmentInBaseCurrency |
|
|
? totalValueInBaseCurrency |
|
|
: currentPositions.currentValue; |
|
|
: currentPositions.currentValue; |
|
|
|
|
|
|
|
|
if ( |
|
|
if ( |
|
@ -571,9 +571,9 @@ export class PortfolioService { |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const isFilteredByCash = filters.some( |
|
|
const isFilteredByCash = filters.some((filter) => { |
|
|
(filter) => filter.type === 'ASSET_CLASS' && filter.id === 'CASH' |
|
|
return filter.type === 'ASSET_CLASS' && filter.id === 'CASH'; |
|
|
); |
|
|
}); |
|
|
|
|
|
|
|
|
if (filters.length === 0 || isFilteredByCash || isFilteredByAccount) { |
|
|
if (filters.length === 0 || isFilteredByCash || isFilteredByAccount) { |
|
|
const cashPositions = await this.getCashPositions({ |
|
|
const cashPositions = await this.getCashPositions({ |
|
|