Release 1.20.1 (#3317)
- improved timesheet calculator with changesets and priority - calculate and include exported stats (e.g. available in export templates) - added hourly rate column to timesheet listing
This commit is contained in:
@@ -328,10 +328,12 @@ class ProjectStatisticService
|
||||
->addSelect('COALESCE(SUM(t.internalRate), 0) as internalRate')
|
||||
->addSelect('COUNT(t.id) as counter')
|
||||
->addSelect('t.billable as billable')
|
||||
->addSelect('t.exported as exported')
|
||||
->andWhere($qb->expr()->in('t.project', ':project'))
|
||||
->andWhere($qb->expr()->isNotNull('t.end'))
|
||||
->groupBy('id')
|
||||
->addGroupBy('billable')
|
||||
->addGroupBy('exported')
|
||||
->setParameter('project', array_keys($statistics))
|
||||
;
|
||||
|
||||
@@ -359,10 +361,20 @@ class ProjectStatisticService
|
||||
$statistic->setInternalRate($statistic->getInternalRate() + $resultRow['internalRate']);
|
||||
$statistic->setCounter($statistic->getCounter() + $resultRow['counter']);
|
||||
if ($resultRow['billable']) {
|
||||
$statistic->setDurationBillable($resultRow['duration']);
|
||||
$statistic->setRateBillable($resultRow['rate']);
|
||||
$statistic->setInternalRateBillable($resultRow['internalRate']);
|
||||
$statistic->setCounterBillable($resultRow['counter']);
|
||||
$statistic->setDurationBillable($statistic->getDurationBillable() + $resultRow['duration']);
|
||||
$statistic->setRateBillable($statistic->getRateBillable() + $resultRow['rate']);
|
||||
$statistic->setInternalRateBillable($statistic->getInternalRateBillable() + $resultRow['internalRate']);
|
||||
$statistic->setCounterBillable($statistic->getCounterBillable() + $resultRow['counter']);
|
||||
if ($resultRow['exported']) {
|
||||
$statistic->setDurationBillableExported($statistic->getDurationBillableExported() + $resultRow['duration']);
|
||||
$statistic->setRateBillableExported($statistic->getRateBillableExported() + $resultRow['rate']);
|
||||
}
|
||||
}
|
||||
if ($resultRow['exported']) {
|
||||
$statistic->setDurationExported($statistic->getDurationExported() + $resultRow['duration']);
|
||||
$statistic->setRateExported($statistic->getRateExported() + $resultRow['rate']);
|
||||
$statistic->setInternalRateExported($statistic->getInternalRateExported() + $resultRow['internalRate']);
|
||||
$statistic->setCounterExported($statistic->getCounterExported() + $resultRow['counter']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user