@extends('reports.pdf.layout')
@section('title', $data['meta']['title'])
@php
$meta = $data['meta'];
$kpis = $data['kpis'];
$evolution = $data['evolution'];
$distribution = $data['distribution'];
$impact = $data['impact'];
$fmtNum = function ($v, $unit = '') {
if ($v === null) return '—';
$s = is_numeric($v) ? number_format((float) $v, 0, ',', ' ') : (string) $v;
return trim($s . ' ' . $unit);
};
$barW = 320; $barH = 140; $barPadX = 28; $barPadY = 22;
// Evolution bars.
$maxE = 100;
$barCount = count($evolution);
$barSlot = $barCount > 0 ? ($barW - 2 * $barPadX) / $barCount : 0;
$barWidth = $barSlot * 0.55;
// Distribution bars.
$maxD = 0;
foreach ($distribution as $d) { $maxD = max($maxD, (int) $d['value']); }
$maxD = max($maxD, 1);
$bcD = count($distribution);
$bsD = $bcD > 0 ? ($barW - 2 * $barPadX) / $bcD : 0;
$bwD = $bsD * 0.55;
@endphp
@section('content')
DADYCAR FLEET MANAGER
{{ $meta['title'] }}
Durabilité ESG
{{ $meta['code'] }}
Période : {{ $meta['period']['label'] }} · {{ $meta['site_label'] }} ·
{{ $meta['total_drivers'] }} conducteurs ·
Généré le {{ $meta['generated_at']->locale('fr')->isoFormat('D MMMM YYYY') }}
Indicateurs clés
Score moyen
{{ $kpis['avg_eco_score']['value'] }}
{{ $kpis['avg_eco_score']['delta_label'] }}
Conducteurs < 60
{{ $kpis['low_score_drivers']['value'] }}
{{ $kpis['low_score_drivers']['delta_label'] }}
Carburant économisé
{{ $fmtNum($kpis['fuel_saved']['value']) }}{{ $kpis['fuel_saved']['unit'] }}
{{ $kpis['fuel_saved']['delta_label'] }}
CO₂ évité
{{ $kpis['co2_avoided_eco']['value'] !== null ? number_format($kpis['co2_avoided_eco']['value'], 1, ',', ' ') : '—' }}{{ $kpis['co2_avoided_eco']['unit'] }}
{{ $kpis['co2_avoided_eco']['delta_label'] }}
Évolution du score éco-conduite vs objectif
Distribution des scores
Impact environnemental et financier (mensuel)
| Indicateur |
Valeur |
@foreach ($impact as $r)
| {{ $r['metric'] }} |
{{ $r['value'] }} |
@endforeach
@endsection