@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $k = $data['kpis']; $sites = $data['sites']; $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 — total cost per site. $bars = $sites; $maxBar = !empty($bars) ? max(1, max(array_map(fn ($b) => (float) ($b['total_cost'] ?? 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 par site sur la période.
@endif| Site | Véh. | Volume (L) | Énergie (kWh) | Coût carb. (€) | Coût recharge (€) | Coût total (€) | Km | L/100km |
|---|---|---|---|---|---|---|---|---|
| {{ $r['site_name'] }} | {{ $r['vehicles'] }} | {{ number_format($r['liters'], 1, ',', ' ') }} | {{ number_format($r['kwh'], 1, ',', ' ') }} | {{ number_format($r['fuel_cost'], 2, ',', ' ') }} | {{ number_format($r['kwh_cost'], 2, ',', ' ') }} | {{ number_format($r['total_cost'], 2, ',', ' ') }} | {{ $r['km'] !== null ? number_format($r['km'], 0, ',', ' ') : '—' }} | {{ $r['l_100km'] !== null ? number_format($r['l_100km'], 2, ',', ' ') : '—' }} |
Aucune donnée à afficher pour les sites.
@endif @endsection