Release 2.0.14 (#3963)
- show customer totals in single-user reports - support custom fonts in export / invoice templates - require daterange for export and invoice searches - improve help label for user locale - show decimal formats in help controller - cache tag amount per request - composer updates - improved code styles - added default label to date picker - new macros & use own macro
This commit is contained in:
@@ -113,6 +113,24 @@ abstract class AbstractUserReportController extends AbstractController
|
||||
$data[$project->getId()]['project'] = $project;
|
||||
}
|
||||
|
||||
return $data;
|
||||
$customers = [];
|
||||
foreach ($data as $id => $row) {
|
||||
$customerId = (string) $row['project']->getCustomer()->getId();
|
||||
if (!\array_key_exists($customerId, $customers)) {
|
||||
$customers[$customerId] = [
|
||||
'customer' => $row['project']->getCustomer(),
|
||||
'projects' => [],
|
||||
'duration' => 0,
|
||||
'rate' => 0.0,
|
||||
'internalRate' => 0.0,
|
||||
];
|
||||
}
|
||||
$customers[$customerId]['projects'][$id] = $row;
|
||||
$customers[$customerId]['duration'] += $row['duration'];
|
||||
$customers[$customerId]['rate'] += $row['rate'];
|
||||
$customers[$customerId]['internalRate'] += $row['internalRate'];
|
||||
}
|
||||
|
||||
return $customers;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user