@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $k = $data['kpis']; $top = $data['top_consumers']; $fmtNum = function ($v, $unit = '') { if ($v === null) return '—'; $s = is_numeric($v) ? number_format((float) $v, ((float) $v) == (int) $v ? 0 : 2, ',', ' ') : (string) $v; return trim($s . ' ' . $unit); }; // Bar chart geometry — top 10 consumers. $bars = $top; $maxBar = !empty($bars) ? max(1, max(array_map(fn ($b) => (float) ($b['consumption'] ?? 0), $bars))) : 1; $barW = 480; $barH = 160; $barPad = 30; $barWidth = !empty($bars) ? max(8, (int) (($barW - 2 * $barPad) / max(1, count($bars))) - 8) : 0; @endphp @section('content')
Aucune consommation enregistrée sur la période.
@endif| Immatriculation | Marque / Modèle | Énergie | Consommation | Écart à la moy. | Coût (€) | Coût annuel (€) | Cause probable |
|---|---|---|---|---|---|---|---|
| {{ $r['plate'] ?? '—' }} | {{ $r['model'] }} | {{ $r['motor'] }} | {{ $r['consumption'] !== null ? number_format($r['consumption'], 2, ',', ' ') . ' ' . $r['unit'] : '—' }} | {{ $r['delta_to_avg'] !== null ? (($r['delta_to_avg'] >= 0 ? '+' : '') . number_format($r['delta_to_avg'], 2, ',', ' ')) : '—' }} | {{ number_format($r['cost'], 2, ',', ' ') }} | {{ $r['annual_cost'] !== null ? number_format($r['annual_cost'], 0, ',', ' ') : '—' }} | {{ $r['cause'] ?? '—' }} |
Cause probable : analyse comportementale à venir (signal éco-conduite non disponible).
@elseAucune donnée à afficher.
@endif @endsection