diff --git a/packages/loot-core/src/client/queries.ts b/packages/loot-core/src/client/queries.ts index 72a15502e4b..2e5852f25f2 100644 --- a/packages/loot-core/src/client/queries.ts +++ b/packages/loot-core/src/client/queries.ts @@ -14,13 +14,17 @@ export function getAccountFilter(accountId, field = 'account') { if (accountId) { if (accountId === 'budgeted') { return { - [`${field}.offbudget`]: false, - [`${field}.closed`]: false, + $and: [ + { [`${field}.offbudget`]: false }, + { [`${field}.closed`]: false }, + ], }; } else if (accountId === 'offbudget') { return { - [`${field}.offbudget`]: true, - [`${field}.closed`]: false, + $and: [ + { [`${field}.offbudget`]: true }, + { [`${field}.closed`]: false }, + ], }; } else if (accountId === 'uncategorized') { return { diff --git a/upcoming-release-notes/1867.md b/upcoming-release-notes/1867.md new file mode 100644 index 00000000000..e1f9b9c2b57 --- /dev/null +++ b/upcoming-release-notes/1867.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [sreetamdas] +--- + +Fix account filter for budgeted and offbudget accounts, fixes #1577