Repository navigation
Conversation
|
I ran this on a test instance with a start day of 26. In budget-month mode the numbers match the Budget page, splits and excluded accounts included, and calendar mode gives the same totals as before. A few things before I merge:
I'll regenerate the .pot when I merge. |
…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>
- Call the choice "Budget periods", as Category Details does (otherworld-dev#447), and word the setting's hint so it holds for any start day. - Compare the hero tiles' "% vs last month" with the same number of days of the previous period, so the 1st no longer reads "down 100%". - Add the feature and both fixes to the changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3eaf49b to
4b8ea3f
Compare
|
Thanks for testing it! All five are in:
PHPUnit, vitest, lint, cs:check and Psalm are green. |
…-grouping Rebuilt budget-app.js on the merged sources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in upstream/dev through otherworld-dev#458's branch; budget-app.js rebuilt on the merged sources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…458) With a Budget Cycle Start Day set, Settings gets Months in dashboard charts and reports, with Calendar months (the default) or Budget periods. The month grouping lives in ReportScope, so splits and excluded accounts and categories are handled the same as before. The trend charts keep their last month, and the hero tiles' % vs last month compares the same number of days of the previous period. Closes #457.
|
Merged on dev as 9e0a869 (squashed), so I'm closing this one by hand. I checked all five here, the bundle matches the source, the hint and "Budget periods" read right, the changelog's in, and the tiles compare like with like on the 1st with start days 1, 10, 26 and 31. I've regenerated the .pot as well. One small thing for a follow-up if you fancy it - on the last day of a period it switches to the whole previous one, so on 28 Feb it compares 28 days with all 31 of January. #472 is built on this branch, so it will want dev merging in. |
Closes #457.
What it does
A new setting next to Budget Cycle Start Day, Months in dashboard charts and reports, offers Calendar months (the default) or Budget months. With budget months and start day 26, a salary on 26 September counts towards October in the charts and reports, the same as on the Budget page and in Category Details.
What it affects:
ReportServicemethods.Unchanged: year-over-year and the digest stay on calendar months. They call the aggregator and query methods directly, so they keep the default
monthStartDay = 1.How
TransactionReportQueries::getCashFlowByMonth(),getCashFlowByMonthByAccount(),getCategoryNetByMonth()and the trend wrappers take an optionalint $monthStartDay = 1.ReportScope::monthBucketExpr()) and rename each date to its budget month withBudgetPeriod::monthContaining()(ReportScope::toBudgetMonths()).mergeReportHalves()then adds up the dates of each month. A transaction has one date, so the summedCOUNT(DISTINCT t.id)still counts each transaction once.ReportAggregatorpassesmonthStartDaythrough and builds the month list with the newBudgetPeriod::monthsBetween().period.monthStartDayandtrends.monthStartDaytell the UI which kind of months it got.ReportServiceasksBudgetCarryoverService::reportMonthStartDay(), which returns the budget start day only whenreport_month_groupingisbudget.Also fixed
trends, which are calendar buckets. With a start day those cut the current period in two, so the comparison disappeared or compared two halves of one period. The dashboard now fetches the previous budget period's summary and compares totals with totals.Testing
ReportServicewiring.dev, and they pass when run alone.cs:check, Psalm andnpm run lintare clean.getCategoryMonthlyReport()no longer matches its changed return statement. I corrected the@returnshape (it was missingmixedCurrency) instead of re-baselining.🤖 Generated with Claude Code