actualbudget / actualbudget/actual

[Bug]: Schedule template budget calculation incorrect for multiple non-monthly scheduled transactions

オープン
#6,513 コメント 13 件 リアクション 2 件 担当者 0 名 GitHub で見る
goal templates
主要言語
TypeScript
スター
28.7k
フォーク
3k
平均マージ
2日 11時間
マージ済み PR(30日)
65

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。