Skip to content

A local-first personal finance app

run schedule rules regardless of posted date (#5870)

Matt Fiddaman2f965266ab7d
diff --git a/packages/loot-core/src/server/transactions/transaction-rules.ts b/packages/loot-core/src/server/transactions/transaction-rules.ts
index 4c2fc61d30..d0f4a6c34c 100644
--- a/packages/loot-core/src/server/transactions/transaction-rules.ts
+++ b/packages/loot-core/src/server/transactions/transaction-rules.ts
@@ -342,8 +342,9 @@ export async function runRules(
// If there is a scheduleRuleID (meaning this transaction came from a schedule) then exclude rules linked to other schedules.
if (scheduleRuleID !== '') {
if (rules[i].id === scheduleRuleID) {
- // if the rule has the same ID that is attached to the schedule then run it (it is the schedules rule).
- finalTrans = rules[i].apply(finalTrans);
+ // bypass condition checking to run the rule even if the transaction date falls outside of the schedule's date range.
+ const changes = rules[i].execActions(finalTrans);
+ finalTrans = Object.assign({}, finalTrans, changes);
} else if (RuleIdsLinkedToSchedules.includes(rules[i].id)) {
// skip all other rules that are linked to other schedules.
continue;
diff --git a/upcoming-release-notes/5870.md b/upcoming-release-notes/5870.md
new file mode 100644
index 0000000000..6a5bf9b820
--- /dev/null
+++ b/upcoming-release-notes/5870.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [matt-fidd]
+---
+
+Run schedule rules regardless of posted date