@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $k = $data['kpis']; $fmtNum = function ($v, $unit = '') { if ($v === null) return '—'; $s = is_numeric($v) ? number_format((float) $v, 0, ',', ' ') : (string) $v; return trim($s . ' ' . $unit); }; // Line chart geometry — two series (acquisition / residual) over 5 quarters. $chartW = 480; $chartH = 160; $padX = 32; $padY = 22; $trend = $data['trend']; $allValues = []; foreach ($trend as $t) { $allValues[] = $t['acq']; $allValues[] = $t['residual']; } $allValues = array_filter($allValues, fn ($v) => $v > 0); $minV = !empty($allValues) ? min($allValues) : 0; $maxV = !empty($allValues) ? max($allValues) : 1; if ($minV === $maxV) { $maxV = $minV + 1; } $stepX = count($trend) > 1 ? ($chartW - 2 * $padX) / (count($trend) - 1) : 0; $project = function ($val) use ($padX, $padY, $chartH, $minV, $maxV) { return $chartH - $padY - (($val - $minV) / ($maxV - $minV)) * ($chartH - 2 * $padY); }; $acqPoints = []; $resPoints = []; foreach ($trend as $i => $t) { $x = $padX + $i * $stepX; $acqPoints[] = ['x' => $x, 'y' => $project($t['acq']), 'label' => $t['label'], 'value' => $t['acq']]; $resPoints[] = ['x' => $x, 'y' => $project($t['residual']), 'label' => $t['label'], 'value' => $t['residual']]; } $acqLine = implode(' ', array_map(fn ($p) => "{$p['x']},{$p['y']}", $acqPoints)); $resLine = implode(' ', array_map(fn ($p) => "{$p['x']},{$p['y']}", $resPoints)); @endphp @section('content')
Aucune donnée financière exploitable sur le parc.
@endif| Immat. | Modèle | Prix achat | Amortissement | Valeur résid. | Cote marché |
|---|---|---|---|---|---|
| {{ $r['plate'] }} | {{ $r['model'] }} | {{ number_format($r['price'], 0, ',', ' ') }} € | {{ number_format($r['depreciation'], 0, ',', ' ') }} € | {{ number_format($r['residual'], 0, ',', ' ') }} € | À venir |
Amortissement linéaire sur 5 ans à partir de la date d'achat / d'entrée en parc. La cote marché n'étant pas disponible dans la base, l'écart est marqué « À venir ».
@elseAucun véhicule avec une valeur d'acquisition renseignée.
@endif @endsection