@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $modelRows = $data['model_rows']; $evolution = $data['evolution']; $fmtNum = function ($v, $unit = '') { if ($v === null) return '—'; $s = is_numeric($v) ? number_format((float) $v, 0, ',', ' ') : (string) $v; return trim($s . ' ' . $unit); }; $barW = 480; $barH = 160; $barPadX = 30; $barPadY = 22; $maxV = 0; foreach ($evolution as $e) { $maxV = max($maxV, $e['malus'] + $e['tax']); } $maxV = max($maxV, 1); $bc = count($evolution); $bs = $bc > 0 ? ($barW - 2 * $barPadX) / $bc : 0; $bw = $bs * 0.55; @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

Malus total acquis
{{ $fmtNum($kpis['malus_total']['value']) }}{{ $kpis['malus_total']['unit'] }}
{{ $kpis['malus_total']['delta_label'] }}
Taxe annuelle CO₂
{{ $fmtNum($kpis['annual_co2_tax']['value']) }}{{ $kpis['annual_co2_tax']['unit'] }}
{{ $kpis['annual_co2_tax']['delta_label'] }}
Acquis sans malus
{{ $kpis['zero_malus']['value'] }}
{{ $kpis['zero_malus']['delta_label'] }}
Économie 100% VE
{{ $fmtNum($kpis['savings_100ve']['value']) }}{{ $kpis['savings_100ve']['unit'] }}
{{ $kpis['savings_100ve']['delta_label'] }}

Malus et taxe annuelle par modèle acquis

@if (!empty($modelRows)) @foreach ($modelRows as $r) @endforeach
Modèle CO₂ Malus Taxe annuelle
{{ $r['model'] }} {{ $r['co2'] }} g/km {{ $r['malus'] === 0 ? 'Exonéré' : $fmtNum($r['malus'], '€') }} {{ $fmtNum($r['tax'], '€') }}
@else

Pas d'acquisitions sur la période.

@endif

Évolution taxe + malus annuels

@if ($maxV > 0) @foreach ($evolution as $i => $e) @php $hM = ($e['malus'] / $maxV) * ($barH - 2 * $barPadY); $hT = ($e['tax'] / $maxV) * ($barH - 2 * $barPadY); $x = $barPadX + $i * $bs + ($bs - $bw) / 2; $yT = $barH - $barPadY - $hT; $yM = $yT - $hM; @endphp {{ $e['label'] }} @endforeach
Malus Taxe annuelle
@endif @endsection