@extends('layouts.app') @section('title', 'Dashboard Financeiro - ERP-PLUS') @section('page_title', 'Dashboard Financeiro') @section('page_subtitle', 'Visao geral das receitas e assinaturas.') @push('styles') @endpush @section('content') @if (session('status'))
{{ session('status') }}
@endif {{-- KPIs --}}
MRR (Receita mensal recorrente)
R$ {{ number_format($mrr, 2, ',', '.') }}
Assinaturas ativas
Recebido no mes
R$ {{ number_format($receivedMonth, 2, ',', '.') }}
{{ now()->translatedFormat('F Y') }}
Cobranças pendentes
R$ {{ number_format($pendingTotal, 2, ',', '.') }}
Aguardando pagamento
Assinaturas ativas
{{ $activeCount }}
{{ $trialCount }} em trial · {{ $expiredCount }} expiradas
{{-- Distribuição por plano --}}

Assinaturas por plano

@forelse ($byPlan as $row) @php $plan = $plans->firstWhere('id', $row->plan_id); @endphp
{{ $plan?->name ?? 'Plano #'.$row->plan_id }}
{{ $row->total }} R$ {{ number_format((float)($plan?->price ?? 0) * $row->total, 2, ',', '.') }}/mes
@php $pct = $activeCount > 0 ? ($row->total / $activeCount * 100) : 0; @endphp
@empty
Nenhuma assinatura ativa.
@endforelse

Acoes rapidas

Gerenciar assinaturas Ver todas as cobranças Gerenciar planos Historico de e-mails
{{-- Ultimas cobranças --}}

Ultimas cobranças

{{ $recentCharges->total() }} total
Ver todas
@forelse ($recentCharges as $charge) @empty @endforelse
Data Empresa Plano Valor Vencimento Status
{{ $charge->created_at->format('d/m/Y H:i') }} {{ $charge->company?->name ?? '-' }} {{ $charge->subscription?->plan?->name ?? '-' }} R$ {{ number_format((float) $charge->amount, 2, ',', '.') }} {{ $charge->due_date?->format('d/m/Y') ?? '-' }} @php $pill = match ($charge->status) { 'received' => 'ok', 'pending' => 'warn', 'refunded' => 'neutral', default => '', }; @endphp {{ mb_strtoupper($charge->status) }} @if ($charge->invoice_url) Link @endif
Nenhuma cobranca encontrada.
@if ($recentCharges->hasPages())
{{ $recentCharges->links() }}
@endif
@endsection