@extends('layouts.app') @section('title', __('Dashboard')) @section('page-title', __('Hi, :name', ['name' => $user->name])) @section('page-subtitle', __('Your space at :tenant', ['tenant' => $user->tenant?->name])) @php $fmt = fn ($v, $d = 0) => number_format((float) $v, $d, ',', ' '); $money = fn ($v) => number_format((float) $v, 2, ',', ' ').' '.$kpis['currency']; @endphp @section('content') {{-- ─── KPI strip ──────────────────────────────────────────────── --}}
{{ __('Requests') }}
{{ $fmt($kpis['requests_total']) }}
{{ __('all time') }}
{{ __('In progress') }}
{{ $fmt($kpis['pending']) }}
{{ __('being prepared') }}
{{ __('Completed') }}
{{ $fmt($kpis['completed']) }}
{{ __('ready or sent') }}
{{ __('Outstanding') }}
@if($kpis['outstanding_count'] > 0) {{ $money($kpis['outstanding_total']) }} @else @endif
@if($kpis['outstanding_count'] > 0) {{ trans_choice(':n unpaid invoice|:n unpaid invoices', $kpis['outstanding_count'], ['n' => $kpis['outstanding_count']]) }} @else {{ __('All paid') }} @endif
{{-- Activity chart --}}

{{ __('Last 30 days') }}

{{ __('Your requests submitted per day') }}

@php $totalRecent = array_sum($recentChart['vals']); @endphp
{{ __('Total') }}
{{ $fmt($totalRecent) }}
@if($totalRecent === 0)
{{ __('No activity in the last 30 days.') }}
@else
{!! \App\Services\Charting\ChartRenderer::render('area', [[ 'label' => __('Requests'), 'values' => $recentChart['vals'], ]], [ 'categories' => $recentChart['cats'], 'width' => 760, 'height' => 220, ]) !!}
@endif
{{-- Quick actions --}}

{{ __('Quick actions') }}

{{-- ─── Recent results ─────────────────────────────────────────── --}}

{{ __('Recent results') }}

{{ __('See all') }}
@forelse($recentResults as $a) @php $label = __(config('finance_analyses.types.'.$a->analysis_type.'.label', $a->analysis_type)); @endphp
{{ $label }}
{{ optional($a->finished_at)->translatedFormat('d M Y · H:i') ?? '—' }}
{{ __('Ready') }}
@empty
{{ __('No completed analyses yet.') }} {{ __('Request your first one.') }}
@endforelse
@endsection