diff --git a/ChangeLog b/ChangeLog index 31d1e573b..43a247965 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,8 @@ + Added feature #714, including Belarus holidays (thanks to Alexei Romanoff). # Tracked Bugs, sorted by ID. + + Fixed bug #605, which gave misleading project completion percentages under + certain circumstances (thanks to Steve Rader). + Fixed bug #703, where global substitutions didn't make all expected annotation changes. + Fixed bug #707, which had inverted logic with the urgency calculation for diff --git a/src/report.cpp b/src/report.cpp index 7b7b4eb2d..eb4012a3b 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -2194,8 +2194,18 @@ std::string onProjectChange (Task& task, bool scope /* = true */) countTasks (all, project, context.tdb.getAllModified (), count_pending, count_done); countTasks (context.tdb.getAllModified (), project, (std::vector ) NULL, count_pending, count_done); + // count_done count_pending percentage + // ---------- ------------- ---------- + // 0 0 0% + // >0 0 100% + // 0 >0 0% + // >0 >0 calculated int percentage = 0; - if (count_done + count_pending > 0) + if (count_done == 0) + percentage = 0; + else if (count_pending == 0) + percentage = 100; + else percentage = (count_done * 100 / (count_done + count_pending)); msg << "Project '"