@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $quarters = $data['quarters']; $rows = $data['rows']; $totals = $data['totals']; $fmtNum = function ($v, $unit = '') { if ($v === null) return '—'; $s = is_numeric($v) ? number_format((float) $v, 0, ',', ' ') : (string) $v; return trim($s . ' ' . $unit); }; // Quarterly bar chart. $barW = 320; $barH = 130; $barPadX = 30; $barPadY = 18; $barMax = max($totals + [1]); $barSlot = ($barW - 2 * $barPadX) / max(1, count($quarters)); $barWidth = $barSlot * 0.55; @endphp @section('content')
DADYCAR FLEET MANAGER

{{ $meta['title'] }}

Dépenses & Coûts {{ $meta['code'] }} Période : {{ $meta['period']['label'] }} · {{ $meta['site_label'] }} · Généré le {{ $meta['generated_at']->locale('fr')->isoFormat('D MMMM YYYY') }}

Indicateurs clés

Total provisions
{{ $fmtNum($kpis['total_provisions']['value']) }}{{ $kpis['total_provisions']['unit'] }}
{{ $kpis['total_provisions']['delta_label'] }}
Provisions renouvellement
{{ $fmtNum($kpis['renewal_provision']['value']) }}{{ $kpis['renewal_provision']['unit'] }}
{{ $kpis['renewal_provision']['delta_label'] }}
Provisions sinistres
{{ $fmtNum($kpis['claims_provision']['value']) }}{{ $kpis['claims_provision']['unit'] }}
{{ $kpis['claims_provision']['delta_label'] }}
Provision T4
{{ $fmtNum($kpis['q4_provision']['value']) }}{{ $kpis['q4_provision']['unit'] }}
{{ $kpis['q4_provision']['delta_label'] }}

Provisions par catégorie et trimestre

@if (!empty($rows)) @foreach ($quarters as $q) @endforeach @foreach ($rows as $r) @foreach ($r['values'] as $v) @endforeach @endforeach
Catégorie{{ $q }}Total
{{ $r['category'] }}{{ $fmtNum($v, '€') }}{{ $fmtNum($r['total'], '€') }}
@else

Aucune provision pour les filtres choisis.

@endif

Calendrier des provisions par trimestre

@if (array_sum($totals) > 0) @foreach ($quarters as $i => $lbl) @php $h = $barMax > 0 ? (($totals[$i] ?? 0) / $barMax) * ($barH - 2 * $barPadY) : 0; $x = $barPadX + $i * $barSlot + ($barSlot - $barWidth) / 2; $y = $barH - $barPadY - $h; @endphp {{ number_format($totals[$i] ?? 0, 0, ',', ' ') }} € {{ $lbl }} @endforeach @else

Pas de provision à afficher.

@endif
@endsection