@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $series = $data['monthly_series']; $open = $data['open_issues']; $fmtNum = function ($v, $unit = '') { if ($v === null) return '—'; $s = is_numeric($v) ? number_format((float) $v, is_float($v) && fmod((float) $v, 1) !== 0.0 ? 1 : 0, ',', ' ') : (string) $v; return trim($s . ' ' . $unit); }; $fmtDelta = function ($v, $unit = '%') { if ($v === null) return null; $sign = $v > 0 ? '+' : ''; return $sign . number_format((float) $v, 1, ',', ' ') . $unit; }; // Bar chart geometry — count of OT per month. $chartW = 480; $chartH = 160; $padX = 30; $padY = 20; $vals = array_map(fn ($r) => (int) $r['count'], $series); $maxV = !empty($vals) ? max($vals) : 0; if ($maxV <= 0) { $maxV = 1; } $barCount = count($series); $availW = $chartW - 2 * $padX; $barW = $barCount > 0 ? ($availW / $barCount) * 0.65 : 0; $stepX = $barCount > 0 ? $availW / max($barCount, 1) : 0; // Status badge palette. $statusColor = [ 'Open' => '#3B82F6', 'Resolved' => '#10B981', 'Closed' => '#6B7280', 'Overdue' => '#EF4444', 'Due soon' => '#F59E0B', ]; @endphp @section('content')
Aucun OT créé sur la période.
@endif| ID | Immat. | Véhicule | Intervention | Statut | Priorité | Ouvert le | Jours | Assigné à |
|---|---|---|---|---|---|---|---|---|
| {{ $r['id'] }} | {{ $r['plate'] }} | {{ $r['vehicle'] }} | {{ $r['name'] }} | {{ $r['status'] }} | {{ $r['priority'] }} | {{ $r['opened_at'] ?? '—' }} | {{ $r['days_open'] ?? '—' }} | {{ $r['assignee'] }} |
Aucun OT en cours.
@endif @endsection