@push('styles') @endpush
{{-- Acciones de gestión: deep-link al Stripe Customer Portal con flow_data específico. Si el user tiene >1 proyecto con stripe_subscription_id, el endpoint del controller muestra modal de selección de proyecto. --}} @php $userPayingProjects = auth()->user() ->tenantProjects() ->whereNotNull('stripe_subscription_id') ->where('stripe_subscription_id', '!=', '') ->get(); @endphp @if($userPayingProjects->count() > 0)

Gestioná tu suscripción

Cambiá tu método de pago, descargá facturas o cancelá la suscripción desde el portal de Stripe.
@php $primaryProject = $userPayingProjects->first(); @endphp
@csrf
@endif

Historial de pagos

Los pagos figuran tal como Stripe los procesó.
@if($invoices->isEmpty())

Aún no tenés pagos registrados

Cuando se procese tu primer cobro, va a aparecer acá automáticamente.

@else {{-- Desktop / tablet: tabla --}}
@foreach($invoices as $invoice) @php $stripeInvoice = method_exists($invoice, 'asStripeInvoice') ? $invoice->asStripeInvoice() : $invoice; $created = isset($stripeInvoice->created) ? \Carbon\Carbon::createFromTimestamp($stripeInvoice->created) : null; $description = $stripeInvoice->lines->data[0]->description ?? 'Suscripción BewPro'; $amount = ($stripeInvoice->total ?? 0) / 100; $currency = strtoupper($stripeInvoice->currency ?? 'usd'); $isPaid = ($stripeInvoice->status ?? '') === 'paid' || !empty($stripeInvoice->paid); $statusLabel = $isPaid ? 'Pagada' : ucfirst($stripeInvoice->status ?? 'pendiente'); $statusBadge = $isPaid ? 'bg-light-success text-success' : 'bg-light-warning text-warning'; @endphp @endforeach
Fecha Concepto Monto Estado PDF
@if($created) {{ $created->format('d/m/Y') }} {{ $created->format('H:i') }} @else @endif {{ $description }} {{ $currency }} {{ number_format($amount, 2) }} {{ $statusLabel }}
{{-- Mobile: cards apiladas --}}
@foreach($invoices as $invoice) @php $stripeInvoice = method_exists($invoice, 'asStripeInvoice') ? $invoice->asStripeInvoice() : $invoice; $created = isset($stripeInvoice->created) ? \Carbon\Carbon::createFromTimestamp($stripeInvoice->created) : null; $description = $stripeInvoice->lines->data[0]->description ?? 'Suscripción BewPro'; $amount = ($stripeInvoice->total ?? 0) / 100; $currency = strtoupper($stripeInvoice->currency ?? 'usd'); $isPaid = ($stripeInvoice->status ?? '') === 'paid' || !empty($stripeInvoice->paid); $statusLabel = $isPaid ? 'Pagada' : ucfirst($stripeInvoice->status ?? 'pendiente'); $statusBadge = $isPaid ? 'bg-light-success text-success' : 'bg-light-warning text-warning'; @endphp
{{ $created ? $created->format('d/m/Y H:i') : '—' }} {{ $statusLabel }}
{{ $description }}
{{ $currency }} {{ number_format($amount, 2) }} PDF
@endforeach
@endif