actualbudget / actualbudget/actual

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

Aperta
#6,513 13 commenti 2 reazioni 0 assegnatari Vedi su GitHub
goal templates
Lingua principale
TypeScript
Stelle
28.8k
Fork
3k
Merge medio
2g 11h
PR unite (30g)
65

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by reproducing the issue in the attached Schedule Template Bug.zip using the listed annual schedules and category template steps. Trace the budget calculation for multiple non-monthly scheduled transactions sharing one category, then verify the result against the expected January, February, March, and April amounts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
electron, typescript
Ambito
backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.