@php $fr = fn ($d) => $d ? \Carbon\CarbonImmutable::parse($d)->locale('fr')->isoFormat('DD MMM YYYY') : __('battery.proofs.none'); $num = fn ($v, $digits = 1) => $v === null ? __('battery.proofs.none') : number_format((float) $v, $digits, ',', ' '); $v = $vehicle; @endphp

{{ __('battery.proofs.title') }}

{{ __('battery.proofs.generated', ['date' => $generated_at->format('d/m/Y H:i')]) }}

{{ __('battery.proofs.vehicle') }}

{{ __('battery.proofs.plate') }}{{ $v['plate'] }}
{{ __('battery.proofs.model') }}{{ trim(($v['make'] ?? '') . ' ' . ($v['model'] ?? '')) }}
{{ __('battery.proofs.site') }}{{ $v['site']['name'] ?? __('battery.proofs.none') }}
{{ __('battery.proofs.chemistry') }}{{ __('battery.chemistry.' . $v['chemistry']) }}
{{ __('battery.proofs.usable') }}{{ $v['usable_kwh'] ? $num($v['usable_kwh']) . ' kWh' : __('battery.proofs.none') }}

{{ __('battery.proofs.warranty') }}

{{ __('battery.proofs.terms') }}{{ $warranty['terms'] ? __('battery.proofs.terms_' . $warranty['terms']) : __('battery.proofs.none') }}
{{ __('battery.proofs.threshold') }}{{ $warranty['threshold'] !== null ? $num($warranty['threshold']) . ' %' : __('battery.proofs.none') }}
{{ __('battery.proofs.duration') }}{{ $warranty['years'] ? __('battery.proofs.years', ['count' => $warranty['years']]) : __('battery.proofs.none') }}
{{ __('battery.proofs.km') }}{{ $warranty['km'] ? $num($warranty['km'], 0) . ' km' : __('battery.proofs.none') }}
{{ __('battery.proofs.start') }}{{ $fr($warranty['start']) }}
{{ __('battery.proofs.end') }}{{ $fr($warranty['end']) }}
{{ __('battery.proofs.status') }}{{ __('battery.warranty.' . $warranty['status']) }}
{{ __('battery.proofs.latest') }} @if ($state['last']) {{ $num($state['soh']) }} % — {{ $fr($state['last']['date']) }}, {{ __('battery.source.' . $state['last']['source']) }}{{ $state['last']['provider'] ? ' ' . $state['last']['provider'] : '' }}{{ $state['last']['mileage'] ? ', ' . $num($state['last']['mileage'], 0) . ' km' : '' }} @else {{ __('battery.proofs.none') }} @endif

{{ __('battery.proofs.measures') }}

@forelse ($history['measures'] as $m) @empty @endforelse
{{ __('battery.proofs.date') }} {{ __('battery.proofs.soh') }} {{ __('battery.proofs.source') }} {{ __('battery.proofs.provider') }} {{ __('battery.proofs.mileage') }} {{ __('battery.proofs.document') }}
{{ $fr($m['date']) }} {{ $num($m['soh']) }} % {{ __('battery.source.' . $m['source']) }} {{ $m['provider'] ?: __('battery.proofs.none') }} {{ $m['mileage'] !== null ? $num($m['mileage'], 0) . ' km' : __('battery.proofs.none') }} {{ $m['document']['name'] ?? __('battery.proofs.none') }}
{{ __('battery.proofs.none') }}

{{ __('battery.proofs.note') }}