actualbudget / actualbudget/actual

[Bug]: Multiple "#template by x repeat every y" lines in same category notes calculate incorrect total budget amount

Aperta
#6,030 11 commenti 0 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?

I'm experiencing a bug with template calculations when multiple "#template by x repeat every y" lines are in the same category. The budgeted amount behaves incorrectly, and strangely actually increases when I remove items. The individual template calculations appear correct when isolated, but the combined calculation in a single category produces incorrect results.

I am using Actual 25.10.0, hosted with docker on my own server. I did not find any other bug reports mentioning this exact issue, but maybe #5585 is related?

### How can we reproduce the issue?

I always use override with budget template to be sure.

1. Create a new empty category with the following templates in the notes field:

```
A
#template-3 800 by 2033-01 repeat every 7 years

B
#template-3 700 by 2033-01 repeat every 7 years

C
#template-3 200 by 2026-03 repeat every 5 years

D
#template-3 80 by 2030-01 repeat every 4 years

E
#template-3 1000 by 2030-01 repeat every 10 years

F
#template-3 400 by 2025-12 repeat every 5 years

G
#template-3 2000 by 2030-01 repeat every 10 years
```

2. Run templates in 2025-10
3. Budgeted amount becomes €781.83

When I run the templates individually i get these amounts:

- A: €9.09
- B: €7.95
- C: €33.33
- D: €1.54
- E: €19.23
- F: €133.33
- G: €38.46
- Expected total: €242.93

4. When removing the A template (keeping B-G), Actual budgets €785.00
5. When removing A and B templates (keeping C-G), actual budgets €787.78

### Where are you hosting Actual?

Docker

### What browsers are you seeing the problem on?

Firefox

### Operating System

None

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Reproduce the calculation from the category notes using the seven templates, then compare the combined result with the individually calculated amounts and the results after removing A and B. Done means the combined total is €242.93 and removing templates no longer increases the budgeted amount.

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

Valutazione

Stack tecnologico
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
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.