From 5751d5d107c46b01a20f7dcd09fded4ec0fbeb4e Mon Sep 17 00:00:00 2001 From: joel-rich <6070705+joel-rich@users.noreply.github.com> Date: Fri, 25 Oct 2024 00:06:10 -0600 Subject: [PATCH] Fix issue with Monthly Spending report not properly averaging previous three months (#3723) * Fix issue with Monthly Spending report not properly summing previous three months * release notes --------- Co-authored-by: Joel Rich --- .../components/reports/spreadsheets/spending-spreadsheet.ts | 6 +++++- upcoming-release-notes/3723.md | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 upcoming-release-notes/3723.md diff --git a/packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts b/packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts index 851b4751efb..997bcd3a5a0 100644 --- a/packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts +++ b/packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts @@ -194,7 +194,11 @@ export function createSpendingSpreadsheet({ } return null; }); - if (month.month >= startDate && month.month < compare) { + + if ( + month.month >= monthUtils.monthFromDate(startDate) && + month.month < compare + ) { if (day === '28') { if (monthUtils.getMonthEnd(intervalItem) === intervalItem) { averageSum += cumulativeAssets + cumulativeDebts; diff --git a/upcoming-release-notes/3723.md b/upcoming-release-notes/3723.md new file mode 100644 index 00000000000..737ce272555 --- /dev/null +++ b/upcoming-release-notes/3723.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [joel-rich] +--- + +Fix issue with Monthly Spending report not properly averaging previous three months