[PR #1016] [MERGED] End of month cleanup script #3467

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1016
Author: @shall0pass
Created: 5/9/2023
Status: Merged
Merged: 5/30/2023
Merged by: @j-f1

Base: masterHead: goalsSweep


📝 Commits (10+)

📊 Changes

7 files changed (+199 additions, -0 deletions)

View changed files

📝 packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx (+4 -0)
📝 packages/loot-core/src/client/actions/queries.ts (+7 -0)
📝 packages/loot-core/src/server/budget/app.ts (+5 -0)
packages/loot-core/src/server/budget/cleanup-template.pegjs (+15 -0)
packages/loot-core/src/server/budget/cleanup-template.ts (+160 -0)
📝 packages/loot-core/src/server/budget/types/handlers.d.ts (+2 -0)
upcoming-release-notes/1016.md (+6 -0)

📄 Description

This is really just a proof of concept. I have no delusions that this might get included. I'm sure others might have a much cleaner implementation.
I'm now delusional.

Resolves https://github.com/actualbudget/actual/issues/508

Taking @youngcw 's advice, I changed the keyword to #cleanup for the end of month script to keep it separated.

This screen video shows two categories that are sources of funds. At the end of the month, any excess in these funds can be redistributed to your highest priorities. Three categories are set as sinks, or recipients, of excess funds.

#cleanup source -> Move 'extra' funds to To Budget
#cleanup sink -> Fund category with To Budget funds, default weight = 1
#cleanup sink 2 -> Fund category with To Budget funds, weight = 2

Steps of the script:

  1. Return funds from any category marked 'source'
  2. Fund overspent categories fully if negative carryover is not allowed.
  3. Fund each 'sink' category by the desired weight.

I run through the script twice. Once to show that if there is a debt category that has a rolling negative balance, it will skip funding that category first and once to show how if a rolling negative balance isn't allowed, it will fund it before applying the weighted remainder. The example shown uses weights of 60, 20, and 20; therefore, the Debt category will receive 60% of the To Budget funds while General and Bills receive 20% each. The weights could have been changed to 6, 2, and 2 or 3 for the Debt category with no additional value for General and Bills to achieve the same result.

cleanup_button


🔄 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/1016 **Author:** [@shall0pass](https://github.com/shall0pass) **Created:** 5/9/2023 **Status:** ✅ Merged **Merged:** 5/30/2023 **Merged by:** [@j-f1](https://github.com/j-f1) **Base:** `master` ← **Head:** `goalsSweep` --- ### 📝 Commits (10+) - [`d54b4b2`](https://github.com/actualbudget/actual/commit/d54b4b2a5a4e56ddf88e691e03cc28acf3a53c8a) initial commit - [`e1f2eec`](https://github.com/actualbudget/actual/commit/e1f2eec5796c48e6511933057e6cdd9b862c3f83) initial commit - [`48322dc`](https://github.com/actualbudget/actual/commit/48322dcc7e41b3c70d7d0914041557892ed112db) lint - [`45173a3`](https://github.com/actualbudget/actual/commit/45173a3534d7c123b54f3e859385571d1d7aad73) fixups - [`0cee857`](https://github.com/actualbudget/actual/commit/0cee857bc785fe638cc57172323c095122905d63) typo + lint - [`f874937`](https://github.com/actualbudget/actual/commit/f874937299c0f22eb48691af4506ae37c797fef9) Merge branch 'actualbudget:master' into goalsSweep - [`7171e51`](https://github.com/actualbudget/actual/commit/7171e51af3126df9fd2af5c7fe740bc58d71c01f) Updated text of error message - [`008de0e`](https://github.com/actualbudget/actual/commit/008de0e2fbe6a3e005a08d57bbdea1d6c85a0279) fix overbudgeting when odd values round - [`882faa7`](https://github.com/actualbudget/actual/commit/882faa7d7eca476e90e7ad8024a575744145e6ec) lint - [`d566014`](https://github.com/actualbudget/actual/commit/d566014eb8a4c9a7b9d4b6b4ac4cc74007600931) use weights instead of percentages ### 📊 Changes **7 files changed** (+199 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx` (+4 -0) 📝 `packages/loot-core/src/client/actions/queries.ts` (+7 -0) 📝 `packages/loot-core/src/server/budget/app.ts` (+5 -0) ➕ `packages/loot-core/src/server/budget/cleanup-template.pegjs` (+15 -0) ➕ `packages/loot-core/src/server/budget/cleanup-template.ts` (+160 -0) 📝 `packages/loot-core/src/server/budget/types/handlers.d.ts` (+2 -0) ➕ `upcoming-release-notes/1016.md` (+6 -0) </details> ### 📄 Description ~This is really just a proof of concept. I have no delusions that this might get included. I'm sure others might have a much cleaner implementation.~ I'm now delusional. Resolves https://github.com/actualbudget/actual/issues/508 Taking @youngcw 's advice, I changed the keyword to #cleanup for the end of month script to keep it separated. This screen video shows two categories that are sources of funds. At the end of the month, any excess in these funds can be redistributed to your highest priorities. Three categories are set as sinks, or recipients, of excess funds. #cleanup source -> Move 'extra' funds to To Budget #cleanup sink -> Fund category with To Budget funds, default weight = 1 #cleanup sink 2 -> Fund category with To Budget funds, weight = 2 Steps of the script: 1. Return funds from any category marked 'source' 2. Fund overspent categories fully if negative carryover is not allowed. 3. Fund each 'sink' category by the desired weight. I run through the script twice. Once to show that if there is a debt category that has a rolling negative balance, it will skip funding that category first and once to show how if a rolling negative balance isn't allowed, it will fund it before applying the weighted remainder. The example shown uses weights of 60, 20, and 20; therefore, the Debt category will receive 60% of the To Budget funds while General and Bills receive 20% each. The weights could have been changed to 6, 2, and 2 or 3 for the Debt category with no additional value for General and Bills to achieve the same result. ![cleanup_button](https://github.com/actualbudget/actual/assets/20625555/56ae2b29-9be6-4e85-b532-1b05cff7c4c7) --- <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-02-28 20:42:04 -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#3467