@extends('layouts.admin') @section('title', __('Invoice')) @section('page-title', __('Invoice')) @section('content')

{{ $invoiceId }}

{{ __('Invoice details') }}

{{ __('Back') }}
@if(($mode ?? 'events') !== 'stripe' && !empty($stripeError))
{{ __('Stripe invoice details could not be loaded. Showing stored webhook entry instead.') }}
{{ $stripeError }}
@endif @php $stripeCustomerId = data_get($invoice, 'customer'); $stripeSubscriptionId = data_get($invoice, 'subscription'); $statusText = (string) data_get($invoice, 'status', ''); $currency = strtoupper((string) data_get($invoice, 'currency', '')); $amountPaid = data_get($invoice, 'amount_paid'); $amountDue = data_get($invoice, 'amount_due'); $amountTotal = data_get($invoice, 'total'); $amountCents = $amountPaid ?? $amountDue ?? $amountTotal; $amount = is_numeric($amountCents) ? ((float) $amountCents / 100) : null; $createdTs = data_get($invoice, 'created'); $createdAt = is_numeric($createdTs) ? \Carbon\Carbon::createFromTimestamp((int) $createdTs) : null; $hostedInvoiceUrl = data_get($invoice, 'hosted_invoice_url'); $invoicePdfUrl = data_get($invoice, 'invoice_pdf'); $badge = match ($statusText) { 'paid' => 'bg-green-100 text-green-800', 'open' => 'bg-yellow-100 text-yellow-800', 'void' => 'bg-gray-100 text-gray-800', 'uncollectible' => 'bg-red-100 text-red-800', 'draft' => 'bg-gray-100 text-gray-800', default => 'bg-gray-100 text-gray-800', }; $raw = json_encode($invoice, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); @endphp
{{ __('Invoice ID') }}
{{ $invoiceId }}
{{ __('Status') }}
{{ $statusText !== '' ? $statusText : '—' }}
{{ __('Customer') }}
@if($customer) {{ $customer->full_name }} ({{ $customer->email }}) @else {{ $stripeCustomerId ?: '—' }} @endif
{{ __('Subscription') }}
@if($subscription)
{{ $subscription->plan_name }}
{{ $subscription->stripe_subscription_id }}
@else {{ $stripeSubscriptionId ?: '—' }} @endif
{{ __('Amount') }}
@if($amount !== null) {{ $currency ? $currency . ' ' : '' }}{{ number_format($amount, 2) }} @else — @endif
{{ __('Created') }}
{{ $createdAt?->format('M d, Y H:i') ?? '—' }}
{{ __('Hosted Invoice URL') }}
@if($hostedInvoiceUrl) {{ $hostedInvoiceUrl }} @else — @endif
{{ __('Invoice PDF') }}
@if($invoicePdfUrl) {{ $invoicePdfUrl }} @else — @endif
@if($event)
{{ __('Webhook') }}
{{ $event->type }}
{{ $event->event_id }}
@endif
{{ $raw ?: '—' }}
@endsection