From 76e6f44991f3fc45ec18724e6b2200a810186e77 Mon Sep 17 00:00:00 2001 From: Seeker4 Date: Wed, 29 May 2019 19:35:19 -0700 Subject: [PATCH] Calculate compliance as number of compliant days / total number of days (instead of days used) so statistics matches overview calculation. --- oscar/statistics.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oscar/statistics.cpp b/oscar/statistics.cpp index 52f94492..a41c5660 100644 --- a/oscar/statistics.cpp +++ b/oscar/statistics.cpp @@ -1492,7 +1492,9 @@ QString StatisticsRow::value(QDate start, QDate end) value = QString("%1").arg(formatTime(p_profile->calcHours(type, start, end) / days)); } else if (calc == SC_COMPLIANCE) { float c = p_profile->countCompliantDays(type, start, end); - float p = (100.0 / days) * c; +// float p = (100.0 / days) * c; + float realDays = qAbs(start.daysTo(end)) + 1; + float p = (100.0 / realDays) * c; value = QString("%1%").arg(p, 0, 'f', 0); } else if (calc == SC_DAYS) { value = QString("%1").arg(p_profile->countDays(type, start, end));