feat(budget): auto-generate recurring entry instances per month
Adds schema migration v3 (recurrence_parent_id column + budget_recurrence_skipped table). On every GET /api/v1/budget, the server checks all recurring originals (is_recurring=1, no parent) and creates missing instances for the requested month using the same day-of-month (clamped to the last day). Deleted instances are recorded in budget_recurrence_skipped so they are not recreated on the next visit. Generated instances are shown with a ↩ indicator in the transaction list. Closes BL-05. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -267,13 +267,14 @@ function renderEntries() {
|
||||
const indClass = isIncome ? 'budget-entry__indicator--income' : 'budget-entry__indicator--expenses';
|
||||
const sign = isIncome ? '+' : '';
|
||||
const date = formatEntryDate(e.date);
|
||||
const recurTag = e.is_recurring ? ' 🔁' : (e.recurrence_parent_id ? ' ↩' : '');
|
||||
|
||||
return `
|
||||
<div class="budget-entry" data-id="${e.id}">
|
||||
<div class="budget-entry__indicator ${indClass}"></div>
|
||||
<div class="budget-entry__body">
|
||||
<div class="budget-entry__title">${escHtml(e.title)}</div>
|
||||
<div class="budget-entry__meta">${date} · ${escHtml(e.category)}${e.is_recurring ? ' 🔁' : ''}</div>
|
||||
<div class="budget-entry__meta">${date} · ${escHtml(e.category)}${recurTag}</div>
|
||||
</div>
|
||||
<div class="budget-entry__amount ${amtClass}">${sign}${formatAmount(e.amount)}</div>
|
||||
<button class="budget-entry__delete" data-action="delete" data-id="${e.id}" aria-label="Eintrag löschen">
|
||||
|
||||
Reference in New Issue
Block a user