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:
Kevin Papst
2023-04-05 19:14:49 +02:00
committed by GitHub
parent 01226a1243
commit 0c397e5080
21 changed files with 458 additions and 493 deletions

View File

@@ -307,8 +307,8 @@ final class DoctorController extends AbstractController
}
$phpInfo = $phpinfo['phpinfo'];
unset($phpInfo[0]);
unset($phpInfo[1]);
array_pop($phpInfo);
array_shift($phpInfo);
return $phpInfo;
}

View File

@@ -36,6 +36,7 @@ final class HelpController extends AbstractController
$table->addColumn('date', ['class' => 'alwaysVisible w-min', 'orderBy' => false]);
$table->addColumn('time', ['class' => 'alwaysVisible w-min text-center', 'orderBy' => false]);
$table->addColumn('duration', ['class' => 'd-none w-min text-end', 'orderBy' => false]);
$table->addColumn('decimal', ['class' => 'd-none w-min text-end', 'orderBy' => false, 'title' => 'Decimal']);
$table->addColumn('money', ['class' => 'w-min text-end', 'orderBy' => false, 'title' => 'rate']);
$table->addColumn('hour_24', ['class' => 'alwaysVisible w-min text-center', 'orderBy' => false]);
$table->addColumn('rtl', ['class' => 'd-none w-min text-center', 'orderBy' => false, 'title' => 'RTL']);
@@ -75,6 +76,7 @@ final class HelpController extends AbstractController
'date' => $formatter->dateShort($now),
'time' => $formatter->time($now),
'duration' => $formatter->duration(46120),
'decimal' => $formatter->durationDecimal(46120),
'money' => $formatter->money(2794.83, 'EUR'),
'hour_24' => $service->is24Hour($locale),
'rtl' => $service->isRightToLeft($locale),

View File

@@ -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;
}
}