diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index ace2c4d729..cf9fcd9c3f 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -340,7 +340,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; - + children)) echo "data-children=" . count($story->children);?> data-cases='id, 0);?>'> from = $from;?> app->getViewType() == 'xhtml'):?> from = $from;?> children)) ? ' table-child-bottom' : '';?> - + app->getViewType() == 'xhtml'):?> $value) @@ -695,18 +695,30 @@ $(function() var checkedEstimate = 0; var checkedCase = 0; + var rateCount = checkedTotal; $checkedRows.each(function() { var $row = $(this); - if ($originTable) + if($originTable) { $row = $originTable.find('tbody>tr[data-id="' + $row.data('id') + '"]'); } var data = $row.data(); checkedEstimate += data.estimate; - if(data.cases > 0) checkedCase += 1; + + if(data.cases > 0) + { + checkedCase += 1; + } + else if(data.children != undefined && data.children > 0) + { + rateCount -= 1; + } }); - var rate = Math.round(checkedCase / checkedTotal * 10000 / 100) + '' + '%'; + + var rate = '0%'; + if(rateCount) rate = Math.round(checkedCase / rateCount * 10000 / 100) + '' + '%'; + return checkedSummary.replace('%total%', checkedTotal) .replace('%estimate%', checkedEstimate.toFixed(1)) .replace('%rate%', rate);