From 8a34ed96a566aa722f346110c820703dfffa01f9 Mon Sep 17 00:00:00 2001 From: Humdinger Date: Fri, 23 Aug 2024 20:07:21 +0200 Subject: [PATCH] Quarterly report: fix quater column label A rounding error caused a wrongly labeled quarter column. E.g. setting a start date of 1st Oct. labeled the column "Q3" --- src/CashFlowReport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CashFlowReport.cpp b/src/CashFlowReport.cpp index 44f91cc..fd0a369 100644 --- a/src/CashFlowReport.cpp +++ b/src/CashFlowReport.cpp @@ -184,7 +184,7 @@ ReportWindow::ComputeCashFlow(void) case SUBTOTAL_QUARTER: { char year[10]; - int quarternumber = ((timestruct->tm_mon + 2) / 3) + 1; + int quarternumber = (ceil(timestruct->tm_mon / 3) + 1); strftime(year, 10, "%Y", timestruct); sprintf(columntitle, "Q%d %s", quarternumber, year); break;