@extends('site.account.shell') @php use App\Support\SiteFormat; $dec = $siteLocale === 'en' ? '.' : ','; $series = $stats['series']; $max = $series ? max($series) : 0; $min = $series ? min($series) : 0; $fuels = $vehicle->fuels(); $multi = count($fuels) > 1; $unitOf = fn ($fuel) => $fuel?->category === 'electric' ? 'kWh' : 'l'; $unit = $unitOf($vehicle->fuelType); $prices = collect($suggestedPrices)->map(fn ($p) => $p ? number_format($p, 3, '.', '') : '')->all(); $fuelById = collect($fuels)->keyBy('id'); @endphp @section('title', $vehicle->displayName()) @section('panel')
← {{ __('site.acc.vehicles_title') }} {{ __('site.acc.edit') }}
@include('site.account.partials.vehicle-cockpit', ['vehicle' => $vehicle, 'stats' => $stats, 'actions' => false])
@if (count($series) >= 2)

{{ __('site.acc.chart_title') }}

@endif

{{ __('site.acc.add_log') }}

@csrf @if ($errors->any())

{{ $errors->first() }}

@endif @if ($multi)
{{ __('site.acc.log_fuel') }} @foreach ($fuels as $fuel) @endforeach
@endif

{{ __('site.acc.logs_title') }}

@if ($logs->isEmpty())

{{ __('site.acc.no_logs') }}

{{ __('site.acc.no_logs_lead') }}

@else
@if ($multi)@endif @foreach ($logs as $log) @if ($multi)@endif @endforeach
{{ __('site.acc.log_date') }} {{ __('site.acc.log_odometer') }}{{ __('site.acc.log_fuel') }}{{ $unit === 'kWh' ? 'kWh' : __('site.acc.log_volume') }} {{ __('site.acc.log_price') }} {{ __('site.acc.log_total') }} {{ __('site.acc.delete') }}
{{ SiteFormat::date($log->logged_at, 'D MMM YYYY') }} @unless ($log->is_full_tank){{ __('site.acc.log_partial') }}@endunless {{ $log->odometer !== null ? number_format($log->odometer, 0, $dec, ' ') : '–' }}{{ \App\Services\Web\MarketBoard::fuelLabel(($fuelById[$log->fuel_type_id] ?? $vehicle->fuelType)?->code ?? '') }}{{ number_format((float) $log->volume, 2, $dec, '') }} {{ $log->volume_unit === 'kwh' ? 'kWh' : '' }} {{ $log->unit_price !== null ? number_format((float) $log->unit_price, 3, $dec, '') : '–' }} {{ number_format($costOf($log), 2, $dec, ' ') }} €
@csrf @method('DELETE')
@endif
@endsection