From 67fcfd6b8fc875104d23471436504098d1890446 Mon Sep 17 00:00:00 2001 From: Marco0300 Date: Tue, 1 Sep 2026 23:38:38 +0200 Subject: [PATCH] feat: report technician hours by performed date and line item --- public/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/index.php b/public/index.php index 067444f..bb8a871 100644 --- a/public/index.php +++ b/public/index.php @@ -328,7 +328,7 @@ if ($route === 'jobcard') { if (can('jobcards.internal_notes')) echo '

Internal notes

'; echo '

Time entries

' . e(number_format($totalHours, 2)) . ' hours
'; foreach ($timeEntries as $entry) echo '
' . e($entry['technician_name']) . ' · ' . e($entry['work_date']) . ' · ' . e(number_format((float)$entry['hours'], 2)) . 'h
' . e((string)($entry['notes'] ?? '')) . '
' . (can('time_entries.record') ? 'Correct or void' : '') . '
'; - if (can('time_entries.record')) { echo '
'; if ($user['role_name'] !== 'Technician') { echo '
'; } echo '
'; } + if (can('time_entries.record')) { echo '
'; if ($user['role_name'] !== 'Technician') { echo '
'; } echo '
'; } echo '

Status

Assigned technicians

'; @@ -774,6 +774,10 @@ if ($route === 'reports') { $detailData[] = ['TOTAL HOURS', '', '', '', '', '', '', '', round($totalReportHours, 2)]; if ($format === 'xls') { header('Content-Type: application/vnd.ms-excel; charset=UTF-8'); header('Content-Disposition: attachment; filename="jobcard-detail-report.xls"'); header('Cache-Control: no-store'); echo ''; foreach ($detailHeaders as $header) echo ''; echo ''; foreach ($detailData as $row) { echo ''; foreach ($row as $cell) echo ''; echo ''; } echo '
' . e($header) . '
' . e((string)($cell ?? '')) . '
'; exit; } if ($format === 'print') { header('Content-Type: text/html; charset=UTF-8'); header('Cache-Control: no-store'); echo (new \PrintReportRenderer())->render('Detailed jobcard report', $detailHeaders, $detailData); exit; } + if ($format === null || $format === '') { + render_header('Detailed report'); + echo '

Detailed report

Each time entry is shown as its own line item.

'; foreach ($detailHeaders as $header) echo ''; echo ''; foreach ($detailData as $row) { echo ''; foreach ($row as $cell) echo ''; echo ''; } echo '
' . e($header) . '
' . nl2br(e((string)($cell ?? ''))) . '
'; render_footer(); exit; + } } $where = []; $params = [];