Feature/exclude fees from holdings (#3160)
This commit is contained in:
parent
e21563d903
commit
7e28e42995
@ -356,16 +356,22 @@ export class PortfolioService {
|
|||||||
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0
|
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let types = getAllActivityTypes().filter((activityType) => {
|
||||||
|
return activityType !== 'FEE';
|
||||||
|
});
|
||||||
|
|
||||||
|
if (withLiabilities === false) {
|
||||||
|
types = types.filter((activityType) => {
|
||||||
|
return activityType !== 'LIABILITY';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const { activities, portfolioOrders, transactionPoints } =
|
const { activities, portfolioOrders, transactionPoints } =
|
||||||
await this.getTransactionPoints({
|
await this.getTransactionPoints({
|
||||||
filters,
|
filters,
|
||||||
|
types,
|
||||||
userId,
|
userId,
|
||||||
withExcludedAccounts,
|
withExcludedAccounts
|
||||||
types: withLiabilities
|
|
||||||
? undefined
|
|
||||||
: getAllActivityTypes().filter((activityType) => {
|
|
||||||
return activityType !== 'LIABILITY';
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const portfolioCalculator = new PortfolioCalculator({
|
const portfolioCalculator = new PortfolioCalculator({
|
||||||
|
@ -139,7 +139,7 @@ export function extractNumberFromString({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getAllActivityTypes(): ActivityType[] {
|
export function getAllActivityTypes(): ActivityType[] {
|
||||||
return ['BUY', 'DIVIDEND', 'FEE', 'ITEM', 'LIABILITY', 'SELL'];
|
return Object.values(ActivityType);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAssetProfileIdentifier({ dataSource, symbol }: UniqueAsset) {
|
export function getAssetProfileIdentifier({ dataSource, symbol }: UniqueAsset) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user