[GH-ISSUE #6513] [Bug]: Schedule template budget calculation incorrect for multiple non-monthly scheduled transactions #44411

Open
opened 2026-04-26 05:32:19 -05:00 by GiteaMirror · 13 comments
Owner

Originally created by @johnallison0 on GitHub (Dec 30, 2025).
Original GitHub issue: https://github.com/actualbudget/actual/issues/6513

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

If you create multiple annual schedules with different end dates and add them as part of a template schedule to a single category the budget calculation is incorrect.

How can we reproduce the issue?

Steps to reproduce

  1. Create a new category called "Test Bills"

Schedule Template Bug.zip

  1. Create two annual scheduled transactions (bug exists with the 'Repeats' checkbox in either state):

    • Bill A: Total amount £100, due in February (2 months away)
    • Bill B: Total amount £90, due in March (3 months away)
  2. In December, budget £50 towards Bill A and £30 towards Bill B (total: £80 in the Test Bills category)

  3. In January, add both schedule templates to the Test Bills category:

   #template schedule Bill A
   #template schedule Bill B

Expected behaviour

  • January: (100-50)/2 + (90-30)/3 = £25 + £20 = £45
  • February: (100-50)/2 + (90-30)/3 = £25 + £20 = £45
  • March: 0 + (90-30)/3 = £0 + £20 = £20
  • April: £0

Actual behaviour

  • January: £40 (£5 short)
  • February: £35 (£10 short)
  • March: £0 (£20 short)
  • April: £0

The template under-budgets in every month where funds are needed, with the shortfall increasing as the due dates approach.

I've attached a simple file that demonstrates the above.

Workaround

Each schedule template works correctly when:

  • Used alone in the category, or
  • Placed in separate categories

The bug only occurs when multiple schedules with different due dates are combined in the same category.

Where are you hosting Actual?

Desktop App (Electron)

What browsers are you seeing the problem on?

Desktop App (Electron)

Operating System

Linux

Originally created by @johnallison0 on GitHub (Dec 30, 2025). Original GitHub issue: https://github.com/actualbudget/actual/issues/6513 ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? If you create multiple annual schedules with different end dates and add them as part of a template schedule to a single category the budget calculation is incorrect. ### How can we reproduce the issue? ## Steps to reproduce 1. **Create a new category** called "Test Bills" [Schedule Template Bug.zip](https://github.com/user-attachments/files/24387984/Schedule.Template.Bug.zip) 2. **Create two annual scheduled transactions** (bug exists with the 'Repeats' checkbox in either state): - **Bill A**: Total amount £100, due in February (2 months away) - **Bill B**: Total amount £90, due in March (3 months away) 3. **In December, budget £50 towards Bill A and £30 towards Bill B** (total: £80 in the Test Bills category) 4. **In January, add both schedule templates to the Test Bills category:** ``` #template schedule Bill A #template schedule Bill B ``` ## Expected behaviour - **January**: (100-50)/2 + (90-30)/3 = £25 + £20 = **£45** - **February**: (100-50)/2 + (90-30)/3 = £25 + £20 = **£45** - **March**: 0 + (90-30)/3 = £0 + £20 = **£20** - **April**: £0 ## Actual behaviour - **January**: £40 (£5 short) - **February**: £35 (£10 short) - **March**: £0 (£20 short) - **April**: £0 The template under-budgets in every month where funds are needed, with the shortfall increasing as the due dates approach. I've attached a simple file that demonstrates the above. ## Workaround Each schedule template works correctly when: - Used alone in the category, or - Placed in separate categories The bug only occurs when multiple schedules with different due dates are combined in the same category. ### Where are you hosting Actual? Desktop App (Electron) ### What browsers are you seeing the problem on? Desktop App (Electron) ### Operating System Linux
GiteaMirror added the goal templatesbug labels 2026-04-26 05:32:19 -05:00
Author
Owner

@vfhykrmh4k-dot commented on GitHub (Jan 9, 2026):

Bug Report: #template schedule ignores deadline after first month

I am experiencing a similar issue where the template engine loses track of deadlines once a category has an existing balance. I believe these are related to the logic issues discussed in #6513.

Issue: #template schedule reverts to 1/12th math

Template: #template schedule Cellphone ($210 due 03/13/2026)

Month Expected Budget Actual Budget Status
Jan $70.00 $70.00 Correct ($210 / 3 months)
Feb $70.00 $17.50 Bug: Defaults to 1/12th ($210/12)
Mar $70.00 $17.50 Bug: Defaults to 1/12th ($210/12)
TOTAL $210.00 $105.00 Under-budgeted by 50%

Despite a specific schedule date in March 2026, the engine ignores the deadline once a balance exists

The template engine calculates the first month correctly but then drops to a default 1/12th calculation for the remaining months, failing to hit the goal by the schedule date.

The Error: The engine correctly identifies the "Months Remaining" in the first month, but once a balance exists in the category, it loses track of the deadline and reverts to a standard annual division.

<!-- gh-comment-id:3730003333 --> @vfhykrmh4k-dot commented on GitHub (Jan 9, 2026): ### Bug Report: #template schedule ignores deadline after first month I am experiencing a similar issue where the template engine loses track of deadlines once a category has an existing balance. I believe these are related to the logic issues discussed in **#6513**. #### Issue: #template schedule reverts to 1/12th math **Template:** `#template schedule Cellphone` ($210 due 03/13/2026) | Month | Expected Budget | Actual Budget | Status | |---|---|---|---| | Jan | $70.00 | $70.00 | Correct ($210 / 3 months) | | Feb | $70.00 | $17.50 | Bug: Defaults to 1/12th ($210/12) | | Mar | $70.00 | $17.50 | Bug: Defaults to 1/12th ($210/12) | | **TOTAL** | **$210.00** | **$105.00** | Under-budgeted by 50% | Despite a specific schedule date in March 2026, the engine ignores the deadline once a balance exists The template engine calculates the first month correctly but then drops to a default 1/12th calculation for the remaining months, failing to hit the goal by the schedule date. The Error: The engine correctly identifies the "Months Remaining" in the first month, but once a balance exists in the category, it loses track of the deadline and reverts to a standard annual division.
Author
Owner

@youngcw commented on GitHub (Jan 9, 2026):

The core issue seems to be that these aren't repeating schedules, so calculating how much is needed per month gets weird when they are stacked.

<!-- gh-comment-id:3730332073 --> @youngcw commented on GitHub (Jan 9, 2026): The core issue seems to be that these aren't repeating schedules, so calculating how much is needed per month gets weird when they are stacked.
Author
Owner

@vfhykrmh4k-dot commented on GitHub (Jan 9, 2026):

The core issue seems to be that these aren't repeating schedules, so calculating how much is needed per month gets weird when they are stacked.

Unfortunately the calculations are also a mess with repeating schedules

Issue 3: Staggered "By Date" templates causing over-budgeting (Front-loading)

When multiple #template [amount] by [date] lines are used in one category with staggered deadlines, the engine fails to silo the balance for each line.

The Setup:

  • #template 203.18 by 2026-03 repeat every year
  • #template 129.50 by 2026-05 repeat every year
  • #template 1550.00 by 2026-05 repeat every year
  • #template 1500.00 by 2026-12 repeat every year

January 2026 Math Breakdown:

Goal Item Calculation Expected Actual Result Discrepancy
HVAC $203.18 / 3 mo $67.73 $85.22 +$17.49
RO Filters $129.50 / 5 mo $25.90 $38.40 +$12.50
Pressure Wash $1550.00 / 5 mo $310.00 $327.42 +$17.42
Road Maint $1500.00 / 12 mo $125.00 $208.22 +$83.22
TOTAL $525.63 $659.26 +$133.63

The Error:
The engine is over-budgeting by $133.63 in January. Instead of performing four independent "siloed" calculations, the logic "front-loads" future obligations (specifically from the December Road Maintenance goal) into the current month. This occurs because the engine cannot distinguish between the multiple staggered deadlines and attempts to over-collect early to "protect" the March deadline.

The Impact:
This creates an unstable budget flow. By over-collecting now, the engine will eventually "dip" the suggested amounts significantly below the required monthly averages once the early-year goals are spent, making the template appear unreliable for level-funding.

<!-- gh-comment-id:3730446329 --> @vfhykrmh4k-dot commented on GitHub (Jan 9, 2026): > The core issue seems to be that these aren't repeating schedules, so calculating how much is needed per month gets weird when they are stacked. Unfortunately the calculations are also a mess with repeating schedules #### Issue 3: Staggered "By Date" templates causing over-budgeting (Front-loading) When multiple `#template [amount] by [date]` lines are used in one category with staggered deadlines, the engine fails to silo the balance for each line. **The Setup:** * `#template 203.18 by 2026-03 repeat every year` * `#template 129.50 by 2026-05 repeat every year` * `#template 1550.00 by 2026-05 repeat every year` * `#template 1500.00 by 2026-12 repeat every year` **January 2026 Math Breakdown:** | Goal Item | Calculation | Expected | Actual Result | Discrepancy | |:---|:---|:---|:---|:---| | HVAC | $203.18 / 3 mo | $67.73 | $85.22 | +$17.49 | | RO Filters | $129.50 / 5 mo | $25.90 | $38.40 | +$12.50 | | Pressure Wash | $1550.00 / 5 mo | $310.00 | $327.42 | +$17.42 | | Road Maint | $1500.00 / 12 mo | $125.00 | $208.22 | +$83.22 | | **TOTAL** | | **$525.63** | **$659.26** | **+$133.63** | **The Error:** The engine is over-budgeting by **$133.63** in January. Instead of performing four independent "siloed" calculations, the logic "front-loads" future obligations (specifically from the December Road Maintenance goal) into the current month. This occurs because the engine cannot distinguish between the multiple staggered deadlines and attempts to over-collect early to "protect" the March deadline. **The Impact:** This creates an unstable budget flow. By over-collecting now, the engine will eventually "dip" the suggested amounts significantly below the required monthly averages once the early-year goals are spent, making the template appear unreliable for level-funding.
Author
Owner

@youngcw commented on GitHub (Jan 9, 2026):

When multiple #template [amount] by [date] lines are used in one category with staggered deadlines, the engine fails to silo the balance for each line.

We have never found a good way to do that without storing gobs of information between months.

<!-- gh-comment-id:3730461969 --> @youngcw commented on GitHub (Jan 9, 2026): > When multiple `#template [amount] by [date]` lines are used in one category with staggered deadlines, the engine fails to silo the balance for each line. We have never found a good way to do that without storing gobs of information between months.
Author
Owner

@vipergts450 commented on GitHub (Jan 9, 2026):

We have never found a good way to do that without storing gobs of information between months.

If you took the starting balance for the month for the category and then ran each template line independently, would any data need to be stored between months?

<!-- gh-comment-id:3730477197 --> @vipergts450 commented on GitHub (Jan 9, 2026): > We have never found a good way to do that without storing gobs of information between months. If you took the starting balance for the month for the category and then ran each template line independently, would any data need to be stored between months?
Author
Owner

@vfhykrmh4k-dot commented on GitHub (Jan 9, 2026):

When multiple #template [amount] by [date] lines are used in one category with staggered deadlines, the engine fails to silo the balance for each line.

We have never found a good way to do that without storing gobs of information between months.

Appreciate this, would it be easier to fix the bug in #template schedule as mentioned here? I would rather then use and stack #template schedules.

<!-- gh-comment-id:3730494392 --> @vfhykrmh4k-dot commented on GitHub (Jan 9, 2026): > > When multiple `#template [amount] by [date]` lines are used in one category with staggered deadlines, the engine fails to silo the balance for each line. > > We have never found a good way to do that without storing gobs of information between months. Appreciate this, would it be easier to fix the bug in #template schedule as mentioned [here](https://github.com/actualbudget/actual/issues/6513#issuecomment-3730003333)? I would rather then use and stack #template schedules.
Author
Owner

@youngcw commented on GitHub (Jan 9, 2026):

So this does work properly if you spend the $100 for schedule A in February. March budgets $35 so there is $90 for schedule B. NVM, my other PR partially fixes this. Thats what I get for working on two issues at once.

<!-- gh-comment-id:3730509440 --> @youngcw commented on GitHub (Jan 9, 2026): ~~So this does work properly if you spend the $100 for schedule A in February. March budgets $35 so there is $90 for schedule B.~~ NVM, my other PR partially fixes this. Thats what I get for working on two issues at once.
Author
Owner

@youngcw commented on GitHub (Jan 9, 2026):

So PR #6610 partially fixes this. It budgets exactly whats needed if you do charge schedule A before March. If you don't it budgets too much. Better than not enough I guess. The reason it budgets too much is that since it can tell that schedule A wasn't paid out yet, it tries to budget what is needed on a per month basis for schedule B. The problem is that schedule B doesn't have a calculable per month amount since it doesn't repeat, and we dont have the information about when the schedule was created to use.

Ill keep thinking about if there is anything else I can use

<!-- gh-comment-id:3730558217 --> @youngcw commented on GitHub (Jan 9, 2026): So PR #6610 partially fixes this. It budgets exactly whats needed if you do charge schedule A before March. If you don't it budgets too much. Better than not enough I guess. The reason it budgets too much is that since it can tell that schedule A wasn't paid out yet, it tries to budget what is needed on a per month basis for schedule B. The problem is that schedule B doesn't have a calculable per month amount since it doesn't repeat, and we dont have the information about when the schedule was created to use. Ill keep thinking about if there is anything else I can use
Author
Owner

@vfhykrmh4k-dot commented on GitHub (Jan 10, 2026):

Hi I have used https://deploy-preview-6610.demo.actualbudget.org/ and it fixes my issue.
Eg #template schedule Cellphone ($210 due 03/13/2026)
Jan = $70, Feb = $70, Mar = $70 Total $210

Image

After updating to the latest Edge Docker image (Jan 10 at 7:04) and having cleared my browser cache/local storage I am still having the old issue.
Eg #template schedule Cellphone ($210 due 03/13/2026)
Jan = $70, Feb = $17.50, Mar = $17.50 Total $105

Image

Am I correct in assuming that this Edge build should have applied the fix?

<!-- gh-comment-id:3733073035 --> @vfhykrmh4k-dot commented on GitHub (Jan 10, 2026): Hi I have used https://deploy-preview-6610.demo.actualbudget.org/ and it fixes my issue. Eg #template schedule Cellphone ($210 due 03/13/2026) Jan = $70, Feb = $70, Mar = $70 Total $210 <img width="1161" height="345" alt="Image" src="https://github.com/user-attachments/assets/e22d8113-8ead-4812-8218-10e200e8ecdf" /> After updating to the latest Edge Docker image (Jan 10 at 7:04) and having cleared my browser cache/local storage I am still having the old issue. Eg #template schedule Cellphone ($210 due 03/13/2026) Jan = $70, Feb = $17.50, Mar = $17.50 Total $105 <img width="2304" height="624" alt="Image" src="https://github.com/user-attachments/assets/04dc6239-a0f6-4938-8e04-ee690606d676" /> Am I correct in assuming that this [Edge build](https://github.com/actualbudget/actual/actions/runs/20869683592) should have applied the fix?
Author
Owner

@youngcw commented on GitHub (Jan 10, 2026):

@vfhykrmh4k-dot that looks like a totally different issue than the one presented here. Please open a separate ticket

<!-- gh-comment-id:3733142991 --> @youngcw commented on GitHub (Jan 10, 2026): @vfhykrmh4k-dot that looks like a totally different issue than the one presented here. Please open a separate ticket
Author
Owner

@vfhykrmh4k-dot commented on GitHub (Jan 10, 2026):

I was going to post it in https://github.com/actualbudget/actual/issues/6562 but it's closed and resolved and it's very much the same issue I am experiencing. Eg my issue is resolved in https://deploy-preview-6610.demo.actualbudget.org/ seems like you have already done the work in that demo preview and the corrected code was suppose to have been uploaded with the Edge build last night?
Do you still want me to open a separate ticket? I'm new to Github and am still learning how the work-flow works.

<!-- gh-comment-id:3733164406 --> @vfhykrmh4k-dot commented on GitHub (Jan 10, 2026): I was going to post it in https://github.com/actualbudget/actual/issues/6562 but it's closed and resolved and it's very much the same issue I am experiencing. Eg my issue is resolved in https://deploy-preview-6610.demo.actualbudget.org/ seems like you have already done the work in that demo preview and the corrected code was suppose to have been uploaded with the Edge build last night? Do you still want me to open a separate ticket? I'm new to Github and am still learning how the work-flow works.
Author
Owner

@youngcw commented on GitHub (Jan 10, 2026):

Add steps to recreate your issue on the other ticket then if that one is the same problem. Don't hijack unrelated tickets.

<!-- gh-comment-id:3733168304 --> @youngcw commented on GitHub (Jan 10, 2026): Add steps to recreate your issue on the other ticket then if that one is the same problem. Don't hijack unrelated tickets.
Author
Owner

@vfhykrmh4k-dot commented on GitHub (Jan 10, 2026):

Will do, though my issue is also technically related to 6562 and 6513. Was not wanting to duplicate support tickets but in future I will create a separate ticket if my issue is not exactly as described. Apologies.

<!-- gh-comment-id:3733173147 --> @vfhykrmh4k-dot commented on GitHub (Jan 10, 2026): Will do, though my issue is also technically related to 6562 and 6513. Was not wanting to duplicate support tickets but in future I will create a separate ticket if my issue is not exactly as described. Apologies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#44411