@extends('reports.pdf.layout')
@section('title', $data['meta']['title'])
@php
$meta = $data['meta'];
$kpis = $data['kpis'];
$annual = $data['annual'];
$scope1Decomp = $data['scope1_decomp'];
$csrd = $data['csrd'];
$fmtNum = function ($v, $unit = '') {
if ($v === null) return '—';
$s = is_numeric($v) ? number_format((float) $v, 0, ',', ' ') : (string) $v;
return trim($s . ' ' . $unit);
};
$toneBg = ['danger' => '#FEE2E2', 'warning' => '#FEF3C7', 'info' => '#DBEAFE', 'success' => '#D1FAE5', 'neutral' => '#F3F4F6'];
$toneColor = ['danger' => '#991B1B', 'warning' => '#92400E', 'info' => '#1E3A8A', 'success' => '#065F46', 'neutral' => '#374151'];
$barW = 320; $barH = 160; $barPadX = 28; $barPadY = 22;
$maxV = 0;
foreach ($annual as $a) { $maxV = max($maxV, $a['scope1'] + $a['scope3']); }
$maxV = max($maxV, 1);
$bc = count($annual);
$bs = $bc > 0 ? ($barW - 2 * $barPadX) / $bc : 0;
$bw = $bs * 0.55;
@endphp
@section('content')
DADYCAR FLEET MANAGER
{{ $meta['title'] }}
Durabilité ESG
{{ $meta['code'] }}
Année : {{ $meta['fiscal_year'] }} · {{ $meta['site_label'] }} ·
{{ $meta['total_vehicles'] }} véhicules ·
Généré le {{ $meta['generated_at']->locale('fr')->isoFormat('D MMMM YYYY') }}
Indicateurs clés
Scope 1
{{ $fmtNum($kpis['scope_1']['value']) }}{{ $kpis['scope_1']['unit'] }}
{{ $kpis['scope_1']['delta_label'] }}
Scope 3
{{ $fmtNum($kpis['scope_3']['value']) }}{{ $kpis['scope_3']['unit'] }}
{{ $kpis['scope_3']['delta_label'] }}
Total carbone
{{ $fmtNum($kpis['total_scopes']['value']) }}{{ $kpis['total_scopes']['unit'] }}
{{ $kpis['total_scopes']['delta_label'] }}
Réduction cumulée
{{ $kpis['cumulative_red']['value'] }}
{{ $kpis['cumulative_red']['delta_label'] }}
Bilan carbone annuel — Scope 1 + Scope 3
Scope 1
Scope 3
Décomposition scope 1 (T CO₂)
@foreach ($scope1Decomp as $d)
{{ $d['label'] }} — {{ $fmtNum($d['value']) }} T ({{ $d['meta'] }})
@endforeach
Conformité CSRD
@if (!empty($csrd))
| Élément |
Statut |
@foreach ($csrd as $c)
@php
$tone = $c['status']['tone'] ?? 'neutral';
$bg = $toneBg[$tone]; $fg = $toneColor[$tone];
@endphp
| {{ $c['item'] }} |
{{ $c['status']['label'] ?? '' }} |
@endforeach
@endif
@endsection