@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $byBracket = $data['by_bracket']; $annual = $data['annual']; $simulations = $data['simulations']; $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', 'success' => '#D1FAE5', 'neutral' => '#F3F4F6']; $toneColor = ['danger' => '#991B1B', 'warning' => '#92400E', 'success' => '#065F46', 'neutral' => '#374151']; $barW = 320; $barH = 160; $barPadX = 28; $barPadY = 22; $maxBracket = 0; foreach ($byBracket as $b) { $maxBracket = max($maxBracket, (float) $b['tax']); } $maxBracket = max($maxBracket, 1); $maxAnnual = 0; foreach ($annual as $a) { $maxAnnual = max($maxAnnual, (float) $a['amount']); } $maxAnnual = max($maxAnnual, 1); @endphp @section('content')
DADYCAR FLEET MANAGER

{{ $meta['title'] }}

Fiscalité {{ $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

TVS/TVOM
{{ $fmtNum($kpis['tvs_total']['value']) }}{{ $kpis['tvs_total']['unit'] }}
{{ $kpis['tvs_total']['delta_label'] }}
Véhicules exonérés
{{ $kpis['vehicles_exempt']['value'] }}{{ $kpis['vehicles_exempt']['unit'] }}
{{ $kpis['vehicles_exempt']['delta_label'] }}
Véh. à plus payé
{{ $fmtNum($kpis['top_taxed']['value']) }}{{ $kpis['top_taxed']['unit'] }}
{{ $kpis['top_taxed']['delta_label'] }}
Simulation -10 VE
{{ $fmtNum($kpis['renewal_sim']['value']) }}{{ $kpis['renewal_sim']['unit'] }}
{{ $kpis['renewal_sim']['delta_label'] }}

Répartition TVS/TVOM par tranche CO₂

@php $bc = count($byBracket); $bs = $bc > 0 ? ($barW - 2 * $barPadX) / $bc : 0; $bw = $bs * 0.55; @endphp @foreach ($byBracket as $i => $b) @php $h = $maxBracket > 0 ? (($b['tax'] / $maxBracket) * ($barH - 2 * $barPadY)) : 0; $x = $barPadX + $i * $bs + ($bs - $bw) / 2; $y = $barH - $barPadY - $h; @endphp {{ $b['count'] }} {{ $b['label'] }} @endforeach

Évolution TVS/TVOM annuelle

@php $bc2 = count($annual); $bs2 = $bc2 > 0 ? ($barW - 2 * $barPadX) / $bc2 : 0; $bw2 = $bs2 * 0.55; @endphp @foreach ($annual as $i => $a) @php $h = $maxAnnual > 0 ? (($a['amount'] / $maxAnnual) * ($barH - 2 * $barPadY)) : 0; $x = $barPadX + $i * $bs2 + ($bs2 - $bw2) / 2; $y = $barH - $barPadY - $h; @endphp {{ number_format($a['amount'], 0, ',', ' ') }} {{ $a['label'] }} @endforeach

Simulation d'optimisation fiscale

@foreach ($simulations as $i => $s) @php $tone = $i === 0 ? 'neutral' : ($s['savings'] > 0 ? 'success' : 'neutral'); $bg = $toneBg[$tone]; $fg = $toneColor[$tone]; @endphp @endforeach
Scénario Charge fiscale Évolution Économie
{{ $s['label'] }} {{ $fmtNum($s['amount'], '€') }} {{ number_format($s['delta'], 1, ',', ' ') }}% {{ $s['savings'] > 0 ? '-' : '' }}{{ $fmtNum($s['savings'], '€') }}
@endsection