Repository navigation
Conversation
…therworld-dev#457) A new setting next to the Budget Cycle Start Day chooses whether the dashboard charts and the month-by-month reports (income vs. expenses trend, cash flow, category by month, and their exports) count calendar months, the default, or the user's budget months. With budget months a salary on the 26th counts towards the next month, as on the Budget page. The queries group by date and fold the rows into budget months in PHP, since a budget month can't be cut out of a date in SQL all supported databases run. Year-over-year and the digest keep calendar months. The hero tiles' "vs last month" now compares the current budget period with the whole previous one. It used the summary's calendar-month buckets, which with a start day cut the current period in two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The income vs. expenses trend stepped a month at a time from the start date, so a range starting later in the month than it ends lost its last month (26 Jul - 25 Oct showed no October), and one starting on 31 January skipped February. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… months With budget months chosen for the reports, "This Month" still meant the calendar month, so with start day 26 the report showed two budget months: 1-25 October as October and 26-31 October as November, with the money split between them. The presets now cover whole budget months: This Month is the running budget month, Last 3 Months three of them, and Year to Date and Last Year start with the budget month of January. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…herworld-dev#457) The forecast learned from calendar months whatever the budget start day, and counted a month its history only partly held as a whole one. Bank sync fetches 90 days, so the first month holds only its last days: five days of September, salary included and hardly any spending, made the average savings several times too high. With budget months chosen for the charts and reports, the forecast now learns from the complete budget months before the running one and projects budget months. In either mode a month counts only when every account that held money before its first transaction (an opening balance) has history from the month's start, give or take a weekend of no bookings. An account added after the history window bounds nothing, so adding one does not empty the forecast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #457. Builds on #458: it uses that PR's Months in dashboard charts and reports setting and
BudgetPeriod::monthsBetween(). Until #458 is merged this branch includes its commits; only the last commit, feat(forecast): …, is new here.Problem
The live forecast (Forecast page and dashboard tile,
ForecastService::getLiveForecast()) has two issues that skew its averages.Changes
Budget months: when the user chose budget months in Settings (feat(reports): let dashboard charts and reports count budget months #458), the forecast:
BudgetPeriod::monthContaining()(PatternAnalyzer::aggregateMonthlyData()takes the start day),Calendar mode is unchanged. The cache key includes the start day, and the response carries
monthStartDay. The Forecast page shows the same budget months note as the charts.Complete months only, in both modes: a month counts only when every account that held money before its first transaction has history from that month's start.
TransactionMapper::getFirstTransactionDates()gives each account's first transaction date in one grouped query.Testing
PatternAnalyzer.cs:check, Psalm andnpm run lintare clean.🤖 Generated with Claude Code