From 1c68c3f964c7e26e19821588eb80ea944cad796c Mon Sep 17 00:00:00 2001 From: Sreetam Das Date: Wed, 8 Nov 2023 01:22:32 +0530 Subject: [PATCH] [Bugfix]: Account filter for budgeted and offbudget accounts (#1867) * Update AQL filter for budgeted and offbudget accounts * Add release note --- packages/loot-core/src/client/queries.ts | 12 ++++++++---- upcoming-release-notes/1867.md | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 upcoming-release-notes/1867.md 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