@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 --}}
| Fecha |
Concepto |
Monto |
Estado |
PDF |
@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
|
@if($created)
{{ $created->format('d/m/Y') }}
{{ $created->format('H:i') }}
@else
—
@endif
|
{{ $description }} |
{{ $currency }} {{ number_format($amount, 2) }}
|
{{ $statusLabel }}
|
|
@endforeach
{{-- 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 }}
@endforeach
@endif