echo "</tr>\n"; if ($projectInst->rate || $userInst->rate) { if ($loginInst->hasAccess("task.getSummary")) { echo "<tr>\n"; echo "<td class=list colspan=" . $colspan . " align=right><b>" . $lang['common_roundedSummaryTime'] . " : </b></td>\n"; echo "<td class=list align=right><b>" . $toolInst->formatTime($toolInst->deductibleSeconds($taskInst->getSummary())) . "</b></td>\n"; echo "</tr>\n"; } if ($loginInst->hasAccess("task.getCosts")) { echo "<tr>\n"; if ($taskInst->fixedPrice > "0") { echo "<td class=list colspan=" . $colspan . " align=right><b>" . $lang['common_summaryCosts'] . " </b> (" . $lang['tasks_fixedPrice'] . ") <b>:</b></td>\n"; } else { echo "<td class=list colspan=" . $colspan . " align=right><b>summary costs </b> (" . $taskInst->getRate() . " " . $config['currency'] . "/" . $lang['common_hour'] . ") <b>:</b></td>\n"; } echo "<td class=list align=right><b>" . $toolInst->formatCurrency($taskInst->getCosts(true)) . "</b></td>\n"; echo "</tr>\n"; } if ($loginInst->hasAccess("task.getCustomerCosts")) { echo "<tr>\n"; if ($taskInst->fixedPrice > "0") { echo "<td class=list colspan=" . $colspan . " align=right><b>" . $lang['common_customerCosts'] . "</b> (" . $lang['tasks_fixedPrice'] . ") <b>:</b></td>\n"; } else { echo "<td class=list colspan=" . $colspan . " align=right><b>" . $lang['common_customerCosts'] . "</b> (" . $lang['common_withoutBugsAndTodos'] . ") <b>:</b></td>\n"; } echo "<td class=list align=right><b>" . $toolInst->formatCurrency($taskInst->getCustomerCosts()) . "</b></td>\n"; echo "</tr>\n"; } } echo "</table>\n"; echo "</form>\n";
$sum_private = 0; $costs = 0; $costs_private = 0; $customerSum = 0; $customerCosts = 0; while ($element = current($list)) { $taskInst->activate($element); echo "<tr class=\"light\"><td class=list><nobr><a href=\"" . $toolInst->encodeUrl("index.php?content=taskdetails.php&view=details&taskid=" . $taskInst->id) . "\" title=\"" . $lang['common_showTaskdetails'] . "\">" . substr($taskInst->subject, 0, 15) . "</a></nobr></td>\n"; echo "<td class=list><nobr>" . $toolInst->getTime("d.m.Y, H:i", $taskInst->time) . "</nobr></td>\n"; echo "<td><nobr class=" . $taskInst->getPriorityStyle() . ">" . $taskInst->getPriorityName() . "</nobr></td>\n"; echo "<td><nobr class=" . $taskInst->getTypeStyle() . ">" . $taskInst->getTypeName() . "</nobr></td>\n"; echo "<td><nobr class=" . $taskInst->getStatusStyle() . ">" . $taskInst->getStatusName() . "</nobr></td>\n"; echo "<td class=list align=right><nobr>" . $toolInst->formatTime($taskInst->getSummary()) . "</nobr></td></tr>\n"; $sum += $taskInst->getSummary(); $sum_private += $taskInst->getSummary(true); $costs += $taskInst->getCosts(); $costs_private += $taskInst->getCosts(true); $customerCosts += $taskInst->getCustomerCosts(); $customerSum += $taskInst->getCustomerSummary(); next($list); } echo "<tr><td class=list colspan=6> </td></tr>\n"; echo "<tr>\n"; echo "<td class=list colspan=4 align=right><b>" . $lang['common_summaryTime'] . " : </b></td>\n"; echo "<td class=list colspan=2 align=right><nobr><b>" . $toolInst->formatTime($sum) . "</b></nobr></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td class=list_private colspan=4 align=right><b>" . $lang['common_private_jobs'] . " - " . $lang['common_summaryTime'] . " : </b></td>\n"; echo "<td class=list_private colspan=2 align=right><b>" . $toolInst->formatTime($sum_private) . "</b></td>\n"; echo "</tr>\n"; if ($loginInst->hasAccess("task.getSummary")) {
/** * returns the summary of all costs for this project * @return float costs */ function getCosts() { $taskInst = new task(); $taskInst->filterProjectId = $this->id; $sum = 0; $list = $taskInst->getList(); while ($element = current($list)) { $taskInst->activate($element); $sum += $taskInst->getCosts(); next($list); } return $sum; }
if ($taskInst->hasToPay()) { $customerTaskCosts = $taskCosts; $customerTaskSummary = $taskSum; $customerTaskSummaryRounded = $toolInst->deductibleSeconds($taskSum); } // determine summaries for completed jobs (not only the shown jobs) $completeTaskSummary = $taskInst->getSummary(); $completeTaskCustomerSummary = $taskInst->getCustomerSummary(); // add summaries to overall summaries $costs += $taskCosts; $summary += $taskSum; $summaryRounded += $toolInst->deductibleSeconds($taskSum); $customerCosts += $customerTaskCosts; $customerSummary += $customerTaskSummary; $customerSummaryRounded += $customerTaskSummaryRounded; $completeCosts += $taskInst->getCosts(); $completeSummary += $completeTaskSummary; $completeSummaryRounded += $toolInst->deductibleSeconds($completeTaskSummary); $completeCustomerCosts += $taskInst->getCustomerCosts(); $completeCustomerSummary += $completeTaskCustomerSummary; $completeCustomerSummaryRounded += $toolInst->deductibleSeconds($completeTaskCustomerSummary); if ($loginInst->hasAccess("task.getRate") && !$taskInst->isFixedPrice()) { // rate for current task echo "<tr><td colspan=3 class=list align=right>"; echo "<b>" . $lang['common_rate'] . ": </td>"; echo "<td align=right class=list><b>" . $toolInst->formatCurrency($taskInst->getRate()) . "</b></td></tr>"; $reportInst->append(" <rate>" . $toolInst->formatCurrency($taskInst->getRate()) . "</rate>"); } if ($loginInst->hasAccess("task.getCosts")) { // effective cost for current task (only listed jobs) // echo "<tr><td colspan=3 class=list align=right><b>costs: </td>";