Skip to content

A local-first personal finance app

Goals: fix percent goals in the same priority level not compounding (#1579)

youngcw99dc87d7158c
diff --git a/packages/loot-core/src/server/budget/goaltemplates.ts b/packages/loot-core/src/server/budget/goaltemplates.ts
index e1678bd752..bd526ca42f 100644
--- a/packages/loot-core/src/server/budget/goaltemplates.ts
+++ b/packages/loot-core/src/server/budget/goaltemplates.ts
@@ -618,8 +618,8 @@ async function applyCategoryTemplate(
0,
Math.round(monthlyIncome * (percent / 100)),
);
- if (increment < budgetAvailable || !priority) {
- to_budget = increment;
+ if (increment + to_budget <= budgetAvailable || !priority) {
+ to_budget += increment;
} else {
if (budgetAvailable > 0) to_budget = budgetAvailable;
errors.push(`Insufficient funds.`);
diff --git a/upcoming-release-notes/1579.md b/upcoming-release-notes/1579.md
new file mode 100644
index 0000000000..d453b185ad
--- /dev/null
+++ b/upcoming-release-notes/1579.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [youngcw]
+---
+
+Goals: Fix percentage goals overwriting any previous goal values