[PR #2480] Cleanup tool group enhancement #4324

Closed
opened 2026-02-28 20:54:27 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/2480

State: closed
Merged: Yes


This PR adds new ways to use the cleanup templates.

Group names can now be used to target specific categories.

Examples:

1st category (contributes 50):   #cleanup MyFirstGroup source 
2nd category (contributes 100):   #cleanup MyFirstGroup source 
3rd category (receives 100):   #cleanup MyFirstGroup sink 2 
4th category (receives 50):   #cleanup MyFirstGroup sink
5th category (overspent): #cleanup MyFirstGroup

6th category (contributes 300):   #cleanup My Second Group source 
7th category (receives 200):   #cleanup My Second Group sink 2 
8th category (receives 100):   #cleanup My Second Group sink
9th category (overspent): #cleanup My Second Group

10th category (contributes 700):   #cleanup source
11th category (receives 700):   #cleanup sink

MyFirstGroup
In this example, all source funds from MyFirstGroup will only be distributed within MyFirstGroup. The 5th category also belongs to the group, which is neither a source nor a sink category, will be filled if it is overspent/under funded. The sink categories will then be funded based on the weight given.

My Second Group
All source funds from 'My Second Group' will be distributed to 'My Second Group'. They work independently of one another. The 9th category, which is part of 'My Second Group' will be funded before anything is distributed if it is overspent/under funded and then the funds from 'My Second Group' will be distributed to the sink categories based on weight.

Global
The group disbursements are calculated first (MyFirstGroup and My Second Group).
No source or sink templates that have a group defined will be used in the 'global' portion of the script. Any underfunded category will continue to be funded first (including the categories in groups), as long as the rollover carryover is not present.

After all groups are considered, the script runs as before and distributes the 'global' funds.

If a 'group sink' category is wished to be included in the 'global sink' calculation, a second line of #cleanup sink needs to be added to the category notes.

If anyone has any feedback on the order of operations here, I'm open.
Currently it's:

  1. Find groups
  2. Run groups (source and sink)
  3. Find 'global' source funds and return to 'To Budget'
  4. Fund underfunded categories
  5. Fill sinking funds

I could see a case for moving (2) after (5) in order to fill underfunded categories first and then distribute the groups.

**Original Pull Request:** https://github.com/actualbudget/actual/pull/2480 **State:** closed **Merged:** Yes --- This PR adds new ways to use the cleanup templates. Group names can now be used to target specific categories. Examples: ``` 1st category (contributes 50): #cleanup MyFirstGroup source 2nd category (contributes 100): #cleanup MyFirstGroup source 3rd category (receives 100): #cleanup MyFirstGroup sink 2 4th category (receives 50): #cleanup MyFirstGroup sink 5th category (overspent): #cleanup MyFirstGroup 6th category (contributes 300): #cleanup My Second Group source 7th category (receives 200): #cleanup My Second Group sink 2 8th category (receives 100): #cleanup My Second Group sink 9th category (overspent): #cleanup My Second Group 10th category (contributes 700): #cleanup source 11th category (receives 700): #cleanup sink ``` **MyFirstGroup** In this example, all source funds from MyFirstGroup will only be distributed within MyFirstGroup. The 5th category also belongs to the group, which is neither a source nor a sink category, will be filled if it is overspent/under funded. The sink categories will then be funded based on the weight given. **My Second Group** All source funds from 'My Second Group' will be distributed to 'My Second Group'. They work independently of one another. The 9th category, which is part of 'My Second Group' will be funded before anything is distributed if it is overspent/under funded and then the funds from 'My Second Group' will be distributed to the sink categories based on weight. **Global** The group disbursements are calculated first (MyFirstGroup and My Second Group). No source or sink templates that have a group defined will be used in the 'global' portion of the script. Any underfunded category will continue to be funded first (including the categories in groups), as long as the rollover carryover is not present. After all groups are considered, the script runs as before and distributes the 'global' funds. If a 'group sink' category is wished to be included in the 'global sink' calculation, a second line of ```#cleanup sink ``` needs to be added to the category notes. If anyone has any feedback on the order of operations here, I'm open. Currently it's: 1. Find groups 2. Run groups (source and sink) 3. Find 'global' source funds and return to 'To Budget' 4. Fund underfunded categories 5. Fill sinking funds I could see a case for moving (2) after (5) in order to fill underfunded categories first and then distribute the groups.
GiteaMirror added the pull-request label 2026-02-28 20:54:27 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#4324