Skip to content

fix: Include recurring transactions in account balance calculations#517

Merged
lucaantonelli merged 1 commit intoRIP-Comm:mainfrom
theperu:fix/recurring-transaction-balances
Feb 27, 2026
Merged

fix: Include recurring transactions in account balance calculations#517
lucaantonelli merged 1 commit intoRIP-Comm:mainfrom
theperu:fix/recurring-transaction-balances

Conversation

@theperu
Copy link
Copy Markdown
Collaborator

@theperu theperu commented Feb 26, 2026

🎯 Description

Recurring transaction occurrences were not contributing to account balances. When checkRecurringTransactions() runs at app startup, it generates real transaction rows (with recurring = 1) for each past-due occurrence. However, three queries in account_repository.dart explicitly filtered out any transaction with recurring = 1, meaning these auto-generated entries were completely invisible to balance calculations.

This fix removes that filter so that recurring transaction occurrences are correctly included in account totals, daily balance charts, and monthly balance charts.

Closes: N/A

📱 Changes

  • Removed recurringFilter from selectAll() in AccountRepository — fixes account totals shown on the dashboard and accounts page
  • Removed recurrentFilter from accountDailyBalance() — fixes the daily balance chart on the account detail page
  • Removed recurrentFilter from accountMonthlyBalance() — fixes the monthly balance chart on the account detail page

🧪 Testing Instructions

Behaviour

  1. Create a recurring transaction (e.g. monthly expense of €50) with a fromDate at least one recurrence period in the past
  2. Restart the app so checkRecurringTransactions() runs and generates the occurrence(s)
  3. Verify the account balance on the dashboard reflects the recurring transaction amount
  4. Open the account detail page and verify the daily and monthly balance charts include the recurring transaction

🔍 Checklist for reviewers

  • Code is formatted correctly
  • Tests are passing
  • New tests are added (if needed)
  • Style matches the figma/designer requests
  • Tested on:
    • iOS
    • Android

@lucaantonelli
Copy link
Copy Markdown
Collaborator

LGTM!

@lucaantonelli lucaantonelli merged commit e75d7cf into RIP-Comm:main Feb 27, 2026
1 check passed
Mattia-Sacchi pushed a commit to Mattia-Sacchi/sossoldi that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants