Feature/exclude fees from holdings (#3160)

pull/3161/head
Thomas Kaul 8 months ago committed by GitHub
parent e21563d903
commit 7e28e42995
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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…
Cancel
Save