{{ __('commerce::commerce.bulk.export') }} {{ __('commerce::commerce.bulk.change_status') }} @foreach ($this->statuses as $status => $label) {{ $label }} @endforeach {{ __('commerce::commerce.bulk.extend_period') }} {{-- Subscription Detail Modal --}} @if ($selectedSubscription) @php $statusColor = match($selectedSubscription->status) { 'active' => 'green', 'trialing' => 'blue', 'past_due', 'incomplete' => 'amber', 'paused' => 'zinc', 'cancelled', 'expired' => 'red', default => 'zinc', }; // Calculate billing period progress $periodStart = $selectedSubscription->current_period_start; $periodEnd = $selectedSubscription->current_period_end; $periodProgress = 0; $daysRemaining = 0; $totalDays = 0; if ($periodStart && $periodEnd) { $totalDays = $periodStart->diffInDays($periodEnd); $daysElapsed = $periodStart->diffInDays(now()); $daysRemaining = max(0, now()->diffInDays($periodEnd, false)); $periodProgress = $totalDays > 0 ? min(100, round(($daysElapsed / $totalDays) * 100)) : 0; } @endphp {{ __('commerce::commerce.subscriptions.detail.title') }}
{{-- Status Summary Card --}} {{ __('commerce::commerce.subscriptions.detail.summary') }}
{{ __('commerce::commerce.subscriptions.detail.status') }} {{ ucfirst($selectedSubscription->status) }}
{{ __('commerce::commerce.subscriptions.detail.gateway') }} {{ ucfirst($selectedSubscription->gateway ?? __('commerce::commerce.status.none')) }}
{{ __('commerce::commerce.subscriptions.detail.billing_cycle') }} {{ ucfirst($selectedSubscription->billing_cycle ?? 'monthly') }}
{{ __('commerce::commerce.subscriptions.detail.created') }} {{ $selectedSubscription->created_at->format('d M Y H:i') }}
{{-- Workspace and Package Cards --}}
{{ __('commerce::commerce.subscriptions.detail.workspace') }} {{ $selectedSubscription->workspace?->name }} {{ __('commerce::commerce.subscriptions.detail.package') }} {{ $selectedSubscription->workspacePackage?->package?->name }} {{ $selectedSubscription->workspacePackage?->package?->code }}
{{-- Billing Period Card with Progress --}} {{ __('commerce::commerce.subscriptions.detail.current_period') }} {{-- Progress Bar --}} @if ($periodStart && $periodEnd)
{{ __('commerce::commerce.subscriptions.detail.billing_progress') }} {{ $daysRemaining }} {{ __('commerce::commerce.subscriptions.detail.days_remaining') }}
@endif
{{ __('commerce::commerce.subscriptions.detail.start') }} {{ $selectedSubscription->current_period_start?->format('d M Y') }}
{{ __('commerce::commerce.subscriptions.detail.end') }} {{ $selectedSubscription->current_period_end?->format('d M Y') }}
{{-- Gateway Info Card --}} @if ($selectedSubscription->gateway_subscription_id) {{ __('commerce::commerce.subscriptions.detail.gateway_details') }}
{{ __('commerce::commerce.subscriptions.detail.subscription_id') }} {{ $selectedSubscription->gateway_subscription_id }}
@if ($selectedSubscription->gateway_customer_id)
{{ __('commerce::commerce.subscriptions.detail.customer_id') }} {{ $selectedSubscription->gateway_customer_id }}
@endif @if ($selectedSubscription->gateway_price_id)
{{ __('commerce::commerce.subscriptions.detail.price_id') }} {{ $selectedSubscription->gateway_price_id }}
@endif
@endif {{-- Cancellation Alert --}} @if ($selectedSubscription->cancelled_at)
{{ __('commerce::commerce.subscriptions.detail.cancellation') }}
{{ __('commerce::commerce.subscriptions.detail.cancelled_at') }}: {{ $selectedSubscription->cancelled_at->format('d M Y H:i') }} @if ($selectedSubscription->cancellation_reason) {{ __('commerce::commerce.subscriptions.detail.reason') }}: {{ $selectedSubscription->cancellation_reason }} @endif @if ($selectedSubscription->ended_at) {{ __('commerce::commerce.subscriptions.detail.ended_at') }}: {{ $selectedSubscription->ended_at->format('d M Y H:i') }} @elseif ($selectedSubscription->cancel_at_period_end) {{ __('commerce::commerce.subscriptions.detail.will_end_at_period_end') }} @endif
@endif {{-- Trial Info Alert --}} @if ($selectedSubscription->trial_ends_at)
{{ __('commerce::commerce.subscriptions.detail.trial') }} {{ __('commerce::commerce.subscriptions.detail.trial_ends') }}: {{ $selectedSubscription->trial_ends_at->format('d M Y H:i') }} ({{ $selectedSubscription->trial_ends_at->diffForHumans() }})
@endif
{{ __('commerce::commerce.subscriptions.extend.title') }} {{ __('commerce::commerce.subscriptions.update_status.title') }} {{ __('commerce::commerce.actions.close') }}
@endif
{{-- Status Update Modal --}} @if ($selectedSubscription) {{ __('commerce::commerce.subscriptions.update_status.title') }}
{{ __('commerce::commerce.subscriptions.update_status.workspace') }}
{{ $selectedSubscription->workspace?->name }}
@foreach (array_keys($this->statuses) as $status) @endforeach
{{ __('commerce::commerce.actions.cancel') }} {{ __('commerce::commerce.subscriptions.update_status.title') }}
@endif
{{-- Extend Period Modal --}} @if ($selectedSubscription) {{ __('commerce::commerce.subscriptions.extend.title') }}
{{ __('commerce::commerce.subscriptions.extend.current_period_ends') }}
{{ $selectedSubscription->current_period_end?->format('d M Y H:i') }}
{{ __('commerce::commerce.subscriptions.extend.new_end_date') }}: {{ $selectedSubscription->current_period_end?->addDays($extendDays)->format('d M Y H:i') }}
{{ __('commerce::commerce.actions.cancel') }} {{ __('commerce::commerce.subscriptions.extend.action') }}
@endif