From: Nik Okuntseff <support@anuko.com> Date: Wed, 19 Dec 2018 18:53:27 +0000 (+0000) Subject: A fix for work units in totals only report. X-Git-Tag: timetracker_1.19-1~399 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e489a39d1dd1ad0293c45d887433d47b7734979f;p=timetracker.git A fix for work units in totals only report. --- diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index d46319db..237e39e9 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -471,7 +471,10 @@ class ttReportHelper { // Prepare parts. $time_part = "sum(time_to_sec(l.duration)) as time"; if ($options['show_work_units']) { - $units_part = $user->unit_totals_only ? ", null as units" : ", sum(if(l.billable = 0 or time_to_sec(l.duration)/60 < $user->first_unit_threshold, 0, ceil(time_to_sec(l.duration)/60/$user->minutes_in_unit))) as units"; + $unitTotalsOnly = $user->getConfigOption('unit_totals_only'); + $firstUnitThreshold = $user->getConfigInt('1st_unit_threshold', 0); + $minutesInUnit = $user->getConfigInt('minutes_in_unit', 15); + $units_part = $unitTotalsOnly ? ", null as units" : ", sum(if(l.billable = 0 or time_to_sec(l.duration)/60 < $firstUnitThreshold, 0, ceil(time_to_sec(l.duration)/60/$minutesInUnit))) as units"; } if ($options['show_cost']) { if (MODE_TIME == $user->tracking_mode) @@ -1468,7 +1471,7 @@ class ttReportHelper { $workUnits = $options['show_work_units']; if ($workUnits) { $unitTotalsOnly = $user->getConfigOption('unit_totals_only'); - $firstUnitThreshold = $user->getConfigInt('1st_unit_threshold'); + $firstUnitThreshold = $user->getConfigInt('1st_unit_threshold', 0); $minutesInUnit = $user->getConfigInt('minutes_in_unit', 15); if ($unitTotalsOnly) $work_unit_part = ", if (sum(l.billable * time_to_sec(l.duration)/60) < $firstUnitThreshold, 0, ceil(sum(l.billable * time_to_sec(l.duration)/60/$minutesInUnit))) as units"; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ee01f47f..295fc064 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@ <br> <table cellspacing="0" cellpadding="4" width="100%" border="0"> <tr> - <td align="center"> Anuko Time Tracker 1.18.32.4665 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> | + <td align="center"> Anuko Time Tracker 1.18.33.4666 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> | <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> | <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> | <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>