mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-22 13:40:45 +00:00
Calculate compliance as number of compliant days / total number of days (instead of days used) so statistics matches overview calculation.
This commit is contained in:
parent
c438ef3872
commit
76e6f44991
@ -1492,7 +1492,9 @@ QString StatisticsRow::value(QDate start, QDate end)
|
|||||||
value = QString("%1").arg(formatTime(p_profile->calcHours(type, start, end) / days));
|
value = QString("%1").arg(formatTime(p_profile->calcHours(type, start, end) / days));
|
||||||
} else if (calc == SC_COMPLIANCE) {
|
} else if (calc == SC_COMPLIANCE) {
|
||||||
float c = p_profile->countCompliantDays(type, start, end);
|
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);
|
value = QString("%1%").arg(p, 0, 'f', 0);
|
||||||
} else if (calc == SC_DAYS) {
|
} else if (calc == SC_DAYS) {
|
||||||
value = QString("%1").arg(p_profile->countDays(type, start, end));
|
value = QString("%1").arg(p_profile->countDays(type, start, end));
|
||||||
|
Loading…
Reference in New Issue
Block a user