@extends('layouts.app') @section('content')
User Details
ID: {{ $user->ampeco_user_id ?? 'N/A' }} - {{ $user->full_name ?? 'N/A' }}
@can('view-session-history') @if(auth()->user()->isPartnerAdmin()) @endif @endcan Back
{{-- Filtros de fechas para Partner Admin y Super Admin --}} @if(auth()->user() && (auth()->user()->isPartnerAdmin() || auth()->user()->isSuperAdmin()))
@if(auth()->user()->isSuperAdmin())
@endif
@if(request('start_date') || request('end_date') || (auth()->user()->isSuperAdmin() && request('consumption_type'))) Clear Filters @endif
@endif @if(isset($filters['start_date']) || isset($filters['end_date']) || isset($filters['consumption_type']))
Filtered Statistics: Showing data for the selected filters. Clear filters to see global statistics
@endif
User Information
ID:
{{ $user->ampeco_user_id ?? 'N/A' }}
Name:
{{ $user->full_name ?? 'N/A' }}
Email:
{{ $user->email ?? 'N/A' }}
Phone:
{{ $user->phone ?? 'N/A' }}
Consumption Statistics
Total Amount:
{{ number_format($totalAmount ?? 0, 2, ',', '.') }} €
Total Consumed:
{{ number_format(floor(($totalKwh ?? 0) * 100) / 100, 2, ',', '.') }} kWh
Personal Home:
{{ number_format(floor(($personalKwh ?? 0) * 100) / 100, 2, ',', '.') }} kWh
Semi-Public:
{{ number_format(floor(($commercialPrivateKwh ?? 0) * 100) / 100, 2, ',', '.') }} kWh
C.Public Roaming:
{{ number_format(floor(($publicKwh ?? 0) * 100) / 100, 2, ',', '.') }} kWh
Int Roaming:
{{ number_format(floor(($intRoamingKwh ?? 0) * 100) / 100, 2, ',', '.') }} kWh
Payment Method Statistics
Wallet:
{{ number_format($walletAmount ?? 0, 2, ',', '.') }} €
Credit Card:
{{ number_format($creditCardAmount ?? 0, 2, ',', '.') }} €
Other Methods:
{{ number_format($otherPaymentAmount ?? 0, 2, ',', '.') }} €
@if(isset($filters['consumption_type']) && $filters['consumption_type'] && !empty($consumptionTypeStats))
Detailed Consumption Type Statistics:
@foreach($consumptionTypeStats as $consumptionType => $stats) @endforeach
Consumption Type Sessions Total Amount (€) Total Energy (kWh)
{{ $consumptionType }} {{ $stats['count'] }} {{ number_format($stats['amount'], 2, ',', '.') }} {{ rtrim(rtrim(number_format($stats['kwh'], 4, ',', '.'), '0'), ',') }}
@endif
{{-- TITULO DE HISTORIAL DE SESIONES --}} @if(auth()->user()->isSuperAdmin())

Session History

(From the last two months)

@endif {{-- BLOQUE DE HISTORIAL DE SESIONES --}} @can('view-session-history') @if(!empty($sessions) && $sessions->count() > 0)
@foreach ($sessions as $session) @php $kwh = ($session->energy ?? 0) / 1000; $formattedKwh = rtrim(rtrim(number_format($kwh, 4, ',', '.'), '0'), ','); @endphp @endforeach
Session ID Start End Charger ID - Address Charge Location Payment Type Energy (kWh) Amount (€)
{{ $session->ampeco_session_id ?? 'N/A' }} {{ $session->started_at?->format('d/m/Y H:i') ?? 'N/A' }} {{ $session->stopped_at?->format('d/m/Y H:i') ?? 'N/A' }} {{ $session->ampeco_charge_point_id ?? 'N/A' }} @if ($session->location_address_en === 'ACCESS_DENIED') - access denied @elseif ($session->location_address_en === 'NOT_AVAILABLE') - Int Roaming @elseif ($session->location_address_en) - {{ $session->location_address_en_display ?? 'N/A' }} @endif @if ($session->display_access_type === 'access denied') access denied @elseif ($session->display_access_type === 'not available') Int Roaming @else {{ $session->display_access_type ?? 'N/A' }} @endif {{ $session->display_payment_type ?? 'N/A' }}{{ $formattedKwh }} {{ number_format($session->amount ?? 0, 2, ',', '.') }}
{{-- Pagination Links with Bootstrap styles --}}
{{ $sessions->links('pagination::bootstrap-5') }}
@else
No session history available for this user in the selected period.
@endif @endcan {{-- FIN BLOQUE HISTORIAL --}}
@can('view-session-history') @endcan @push('scripts') @endpush @endsection