[PR #3012] [MERGED] [Goals]: Add a long term goal template #53939

Closed
opened 2026-04-30 23:06:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3012
Author: @youngcw
Created: 7/8/2024
Status: Merged
Merged: 7/26/2024
Merged by: @youngcw

Base: masterHead: youngcw/goal-type-template


📝 Commits (10+)

  • 849ea93 update the parser
  • c7dbdfb can set goal value, but there are errors and it still needs to look for a balance and not month amount
  • 2671ec2 fix apply budget
  • e900ba1 un change
  • ef67559 note
  • 45dfb1f lint
  • a0e6be5 working processing, need to set colors based on month somehow
  • 2103bec add long goal option to the gui and db
  • 0a0abc2 Merge branch 'master' into youngcw/goal-type-template
  • 570d40e note, lint

📊 Changes

16 files changed (+151 additions, -46 deletions)

View changed files

📝 packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx (+5 -2)
📝 packages/desktop-client/src/components/budget/report/ReportComponents.tsx (+1 -0)
📝 packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx (+1 -0)
📝 packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx (+15 -2)
📝 packages/desktop-client/src/components/modals/ReportBalanceMenuModal.tsx (+1 -0)
📝 packages/desktop-client/src/components/modals/RolloverBalanceMenuModal.tsx (+1 -0)
packages/loot-core/migrations/1720665000000_goal_context.sql (+6 -0)
📝 packages/loot-core/src/client/queries.ts (+2 -0)
📝 packages/loot-core/src/server/aql/schema/index.ts (+2 -0)
📝 packages/loot-core/src/server/budget/actions.ts (+3 -1)
📝 packages/loot-core/src/server/budget/base.ts (+3 -0)
📝 packages/loot-core/src/server/budget/cleanup-template.ts (+1 -0)
📝 packages/loot-core/src/server/budget/goal-template.pegjs (+20 -17)
📝 packages/loot-core/src/server/budget/goaltemplates.ts (+83 -24)
📝 packages/loot-core/src/server/sheet.ts (+1 -0)
upcoming-release-notes/3012.md (+6 -0)

📄 Description

This adds in the ability to set a goal in a strict sense. Instead of a monthly auto budget template like what we have had up till now, this adds in the option to set a purely visual goal. This type wont apply anything to the budget but will flag the goal as a "long goal" in the db that is then used to color the balance for personal reference.

For a basic test use a note like #goal 500. Then try out different budget amounts to adjust the balance. If the total balance is <500 it should be marked as unmet. If >=500, met.

The goal directive will not unset the budgeted amount, so the category acts like a normal category, just with a colored balance.

This should work in conjunction with other templates too. For example

#template 100 up to 500
#goal 500

The goals get run after templates so the value to get green coloring is 500 not 100, but 100 will automatically get budgeted. In this case the budgeted amount will get overwritten since there is a template in the category.

Based on #3011
docs: actualbudget/docs#401


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/3012 **Author:** [@youngcw](https://github.com/youngcw) **Created:** 7/8/2024 **Status:** ✅ Merged **Merged:** 7/26/2024 **Merged by:** [@youngcw](https://github.com/youngcw) **Base:** `master` ← **Head:** `youngcw/goal-type-template` --- ### 📝 Commits (10+) - [`849ea93`](https://github.com/actualbudget/actual/commit/849ea938ff25e97e846a61814457174a9442c227) update the parser - [`c7dbdfb`](https://github.com/actualbudget/actual/commit/c7dbdfb0ab5484b49ab571a1dd27d8c41592fce0) can set goal value, but there are errors and it still needs to look for a balance and not month amount - [`2671ec2`](https://github.com/actualbudget/actual/commit/2671ec2e3b98a1555a822728d6e7aea10b1c8901) fix apply budget - [`e900ba1`](https://github.com/actualbudget/actual/commit/e900ba17774a7b4921b457a63aa9a1a5d88e8ba4) un change - [`ef67559`](https://github.com/actualbudget/actual/commit/ef67559ca6ab060140f925aeef1c418138af2244) note - [`45dfb1f`](https://github.com/actualbudget/actual/commit/45dfb1fc0e8ba6b8138c97527763f6ec83721366) lint - [`a0e6be5`](https://github.com/actualbudget/actual/commit/a0e6be5e35b3f80fb5e6f2688fa9191adf81ab77) working processing, need to set colors based on month somehow - [`2103bec`](https://github.com/actualbudget/actual/commit/2103bec4193c14376cc778c539a9b4c12a30289e) add long goal option to the gui and db - [`0a0abc2`](https://github.com/actualbudget/actual/commit/0a0abc25e14ea65ad7e9cfac7a9b43397dd12d6e) Merge branch 'master' into youngcw/goal-type-template - [`570d40e`](https://github.com/actualbudget/actual/commit/570d40e697800f31bd587e4b117ae46ecd0fb9dc) note, lint ### 📊 Changes **16 files changed** (+151 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx` (+5 -2) 📝 `packages/desktop-client/src/components/budget/report/ReportComponents.tsx` (+1 -0) 📝 `packages/desktop-client/src/components/budget/rollover/RolloverComponents.tsx` (+1 -0) 📝 `packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx` (+15 -2) 📝 `packages/desktop-client/src/components/modals/ReportBalanceMenuModal.tsx` (+1 -0) 📝 `packages/desktop-client/src/components/modals/RolloverBalanceMenuModal.tsx` (+1 -0) ➕ `packages/loot-core/migrations/1720665000000_goal_context.sql` (+6 -0) 📝 `packages/loot-core/src/client/queries.ts` (+2 -0) 📝 `packages/loot-core/src/server/aql/schema/index.ts` (+2 -0) 📝 `packages/loot-core/src/server/budget/actions.ts` (+3 -1) 📝 `packages/loot-core/src/server/budget/base.ts` (+3 -0) 📝 `packages/loot-core/src/server/budget/cleanup-template.ts` (+1 -0) 📝 `packages/loot-core/src/server/budget/goal-template.pegjs` (+20 -17) 📝 `packages/loot-core/src/server/budget/goaltemplates.ts` (+83 -24) 📝 `packages/loot-core/src/server/sheet.ts` (+1 -0) ➕ `upcoming-release-notes/3012.md` (+6 -0) </details> ### 📄 Description This adds in the ability to set a goal in a strict sense. Instead of a monthly auto budget template like what we have had up till now, this adds in the option to set a purely visual goal. This type wont apply anything to the budget but will flag the goal as a "long goal" in the db that is then used to color the balance for personal reference. For a basic test use a note like `#goal 500`. Then try out different budget amounts to adjust the balance. If the total balance is <500 it should be marked as unmet. If >=500, met. The goal directive will not unset the budgeted amount, so the category acts like a normal category, just with a colored balance. This should work in conjunction with other templates too. For example ``` #template 100 up to 500 #goal 500 ``` The goals get run after templates so the value to get green coloring is 500 not 100, but 100 will automatically get budgeted. In this case the budgeted amount will get overwritten since there is a template in the category. Based on #3011 docs: actualbudget/docs#401 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 23:06:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#53939