@extends('layouts.app') @section('title', __('app.dashboard.title')) @section('content') @php $tenant = auth()->user()->tenant; $stats = $tenant->getStats(); $recentInvoices = $tenant->invoices()->with('customer')->latest()->take(8)->get(); $overdueInvoices = $tenant->invoices()->where('status', 'overdue')->with('customer')->take(5)->get(); @endphp

{{ __('app.dashboard.welcome') }}, {{ explode(' ', auth()->user()->name)[0] }} 👋

{{ now()->locale('sv')->isoFormat('dddd D MMMM YYYY') }}

{{ __('app.invoices.new') }}
+12%
{{ number_format($stats['total_revenue'], 0, ',', ' ') }} kr
Total intÀkt
{{ $stats['unpaid_invoices'] }} fakturor
{{ number_format($stats['outstanding_amount'], 0, ',', ' ') }} kr
UtestÄende
{{ $overdueInvoices->count() }}
Förfallna fakturor
{{ $stats['total_customers'] }}
Kunder totalt

{{ __('app.dashboard.recent_invoices') }}

Visa alla →
@forelse($recentInvoices as $invoice) @empty @endforelse
Faktura Kund Datum Belopp Status
{{ $invoice->invoice_number }}
{{ $invoice->customer->name }}
{{ $invoice->customer->org_number }}
{{ $invoice->invoice_date->format('d.m.Y') }}
Förfall: {{ $invoice->due_date->format('d.m.Y') }}
{{ number_format($invoice->total, 0, ',', ' ') }} kr
@if($invoice->total_remaining > 0 && $invoice->status !== 'draft')
Kvar: {{ number_format($invoice->total_remaining, 0, ',', ' ') }} kr
@endif
{{ $invoice->status_label }}
Inga fakturor Ă€nnu. Skapa din första faktura →
AI-insikter
Uppdaterades nyss
● @if($overdueInvoices->count() > 0) Du har {{ $overdueInvoices->count() }} förfallna fakturor. Skicka pĂ„minnelser för att förbĂ€ttra kassaflödet. @else Inga förfallna fakturor — bra jobbat! HĂ„ll koll pĂ„ kommande förfallodatum. @endif
● UtestĂ„ende belopp: {{ number_format($stats['outstanding_amount'], 0, ',', ' ') }} kr. Följ upp om 7 dagar.
@if($stats['open_tickets'] > 0)
● {{ $stats['open_tickets'] }} öppna supportĂ€renden vĂ€ntar pĂ„ svar.
@endif
@if($overdueInvoices->count() > 0)
Förfallna fakturor
@foreach($overdueInvoices as $invoice)
{{ $invoice->customer->name }}
{{ $invoice->invoice_number }} · Förföll {{ $invoice->due_date->diffForHumans() }}
{{ number_format($invoice->total_remaining, 0, ',', ' ') }} kr
@csrf
@endforeach
@endif
@push('scripts') @endpush @endsection