@extends("layouts.app") @section("title", __("Billing Management")) @section("header")

{{ __("Billing Management") }}

@endsection @section("content")
@if(session("success"))
{{ session("success") }}
@endif

{{ __("Active Plans") }}

{{ $stats["active_plans"] }}

{{ __("Active Subscriptions") }}

{{ $stats["active_subscriptions"] }}

{{ __("Total Revenue") }}

R$ {{ number_format($stats["total_revenue"], 2, ',', '.') }}

{{ __("Pending Invoices") }}

{{ $stats["pending_invoices"] }}

{{ __("Expiring Soon") }}

{{ $stats["expiring_soon"] }}

{{ __("Subscription Plans") }}

@foreach($plans as $plan)

{{ $plan->name }}

@if($plan->is_active) {{ __("Active") }} @else {{ __("Inactive") }} @endif

R$ {{ number_format($plan->price, 2, ',', '.') }} /{{ $plan->duration_days }}d

{{ $plan->description }}

📅 {{ $plan->duration_days }} {{ __("days") }}

🔤 {{ $plan->token_limit ? number_format($plan->token_limit) . ' tokens' : __('Unlimited tokens') }}

👥 {{ $plan->user_subscriptions_count ?? 0 }} {{ __("subscribers") }}

@endforeach

{{ __("Recent Subscriptions") }}

@foreach($subscriptions as $sub) @endforeach
{{ __("User") }} {{ __("Plan") }} {{ __("Status") }} {{ __("Payment") }} {{ __("Period") }} {{ __("Actions") }}
{{ $sub->user->name }} {{ $sub->plan->name }} {{ ucfirst($sub->status) }} @if($sub->payment_approved) ✅ {{ __("Approved") }} @else ⏳ {{ __("Pending") }} @endif {{ $sub->start_date->format('d/m/Y') }} - {{ $sub->end_date->format('d/m/Y') }}
@if(!$sub->payment_approved)
@csrf
@endif @if($sub->status === 'active')
@csrf
@endif
@if(method_exists($subscriptions, 'links'))
{{ $subscriptions->links() }}
@endif
@endsection @push("scripts") @endpush