fix: balance rule action template variable (#6198)

* fix: balance rule action template variable for transactions without category

* added release notes

---------

Co-authored-by: Tom Griffin <tom.griffin@citypantry.com>
Co-authored-by: Tom Griffin <tomgriffin@Toms-MBP.communityfibre.co.uk>
This commit is contained in:
sys044
2025-11-18 21:48:27 +00:00
committed by GitHub
parent be65d295d0
commit 98174089c9
2 changed files with 13 additions and 7 deletions

View File

@@ -959,13 +959,6 @@ export async function prepareTransactionForRules(
r._account = await getAccount(trans.account);
r._account_name = r._account?.name || '';
}
}
if (trans.category) {
const category = await getCategory(trans.category);
if (category) {
r._category_name = category.name;
}
const dateBoundary = trans.date ?? currentDay();
let query = q('transactions')
@@ -1005,6 +998,13 @@ export async function prepareTransactionForRules(
r.balance = balance ?? 0;
}
if (trans.category) {
const category = await getCategory(trans.category);
if (category) {
r._category_name = category.name;
}
}
return r;
}

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [sys044]
---
Fixes the balance rule action templating variable for uncategorised transactions