Skip to content

A local-first personal finance app

Fix issue with Monthly Spending report not properly averaging previous three months (#3723)

joel-rich5751d5d107c4
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 851b4751ef..997bcd3a5a 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 0000000000..737ce27255
--- /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