fix duration calculation for multiple entries of same activity
This commit is contained in:
@@ -416,7 +416,7 @@ class TimesheetRepository extends EntityRepository
|
|||||||
$newDateBegin = clone $endTmp;
|
$newDateBegin = clone $endTmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure to exclude entries that are outside the requested timerange:
|
// make sure to exclude entries that are outside the requested time-range:
|
||||||
// these entries can exist if you have long running entries that started before $begin
|
// these entries can exist if you have long running entries that started before $begin
|
||||||
// for statistical reasons we have to include everything between $begin and $end while
|
// for statistical reasons we have to include everything between $begin and $end while
|
||||||
// excluding everything that is outside of that range
|
// excluding everything that is outside of that range
|
||||||
@@ -449,6 +449,7 @@ class TimesheetRepository extends EntityRepository
|
|||||||
. '_' . $result->getProject()->getId()
|
. '_' . $result->getProject()->getId()
|
||||||
. '_' . $result->getActivity()->getId()
|
. '_' . $result->getActivity()->getId()
|
||||||
;
|
;
|
||||||
|
|
||||||
if (!isset($results[$dateKey]['details'][$detailsId])) {
|
if (!isset($results[$dateKey]['details'][$detailsId])) {
|
||||||
$results[$dateKey]['details'][$detailsId] = [
|
$results[$dateKey]['details'][$detailsId] = [
|
||||||
'project' => $result->getProject(),
|
'project' => $result->getProject(),
|
||||||
@@ -456,10 +457,10 @@ class TimesheetRepository extends EntityRepository
|
|||||||
'duration' => 0,
|
'duration' => 0,
|
||||||
'rate' => 0,
|
'rate' => 0,
|
||||||
];
|
];
|
||||||
|
|
||||||
$results[$dateKey]['details'][$detailsId]['duration'] += $duration;
|
|
||||||
$results[$dateKey]['details'][$detailsId]['rate'] += $rate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$results[$dateKey]['details'][$detailsId]['duration'] += $duration;
|
||||||
|
$results[$dateKey]['details'][$detailsId]['rate'] += $rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
$beginTmp = $newDateBegin;
|
$beginTmp = $newDateBegin;
|
||||||
|
|||||||
Reference in New Issue
Block a user