@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $objectives = $data['objectives']; $trend = $data['trend']; $actionPlan = $data['action_plan']; $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']; // Line geometry. $lineW = 320; $lineH = 140; $linePadX = 30; $linePadY = 22; $maxLine = 100; $lineSlot = count($trend) > 1 ? ($lineW - 2 * $linePadX) / (count($trend) - 1) : 0; @endphp @section('content')
DADYCAR FLEET MANAGER

{{ $meta['title'] }}

Durabilité ESG {{ $meta['code'] }} Période : {{ $meta['period']['label'] }} · {{ $meta['site_label'] }} · {{ $meta['total_vehicles'] }} véhicules · Généré le {{ $meta['generated_at']->locale('fr')->isoFormat('D MMMM YYYY') }}

Indicateurs clés

Score ESG global
{{ $kpis['esg_score']['value'] }}
{{ $kpis['esg_score']['delta_label'] }}
Objectifs en bonne voie
{{ $kpis['on_track_objectives']['value'] }}
{{ $kpis['on_track_objectives']['delta_label'] }}
Actions en cours
{{ $kpis['actions_in_progress']['value'] }}
{{ $kpis['actions_in_progress']['delta_label'] }}
Investissement ESG T1
{{ $fmtNum($kpis['investment_q1']['value']) }}{{ $kpis['investment_q1']['unit'] }}
{{ $kpis['investment_q1']['delta_label'] }}

Avancement des objectifs ESG 2026

@if (!empty($objectives)) @foreach ($objectives as $o) @php $color = match ($o['tone']) { 'success' => '#10B981', 'warning' => '#F59E0B', 'info' => '#3B82F6', default => '#6B7280', }; @endphp
{{ $o['label'] }}
{{ $o['value'] }} — {{ $o['meta'] }}
@endforeach @else

Aucun objectif filtré.

@endif

Progression trimestrielle des KPIs ESG

@php $px1 = null; $py1 = null; $px2 = null; $py2 = null; @endphp @foreach ($trend as $i => $t) @php $x = $linePadX + $i * $lineSlot; $y1 = $lineH - $linePadY - (($t['ve_share'] / $maxLine) * ($lineH - 2 * $linePadY)); $y2 = $lineH - $linePadY - (($t['eco_score'] / $maxLine) * ($lineH - 2 * $linePadY)); @endphp @if ($px1 !== null) @endif {{ $t['label'] }} @php $px1 = $x; $py1 = $y1; $px2 = $x; $py2 = $y2; @endphp @endforeach
Part VE % Score éco

Plan d'actions ESG

@if (!empty($actionPlan)) @foreach ($actionPlan as $a) @php $tone = $a['status']['tone'] ?? 'neutral'; $bg = $toneBg[$tone]; $fg = $toneColor[$tone]; @endphp @endforeach
Action Statut Impact attendu Échéance
{{ $a['action'] }} {{ $a['status']['label'] ?? '' }} {{ $a['impact'] }} {{ $a['deadline'] }}
@else

Aucune action planifiée.

@endif @endsection