@extends('theme::layouts.app', ['title' => $title ?? __('subscription.title|Subscription Details')]) @section('content')
@php $statusDetails = getSubscriptionStatusDetails($subscription->status); $badgeClass = 'bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400'; $isCancelled = !empty($subscription->cancelled_at); $isActive = $subscription->status === getConstant('SUBSCRIPTION_STATUS_ACTIVE'); $expiryDate = $subscription->end_date ?? $subscription->next_billing_date; // Status Badge Logic if ($isCancelled && $expiryDate > now()) { $badgeClass = 'bg-orange-50 text-orange-600 dark:bg-orange-900/20 dark:text-orange-400'; $statusLabel = __('subscription.Pending Cancellation'); } elseif ($statusDetails['class'] == 'bg-success') { $badgeClass = 'bg-green-50 text-green-600 dark:bg-green-900/20 dark:text-green-400'; $statusLabel = $statusDetails['label']; } elseif ($statusDetails['class'] == 'bg-danger') { $badgeClass = 'bg-red-50 text-red-600 dark:bg-red-900/10 dark:text-red-500'; $statusLabel = $statusDetails['label']; } else { $statusLabel = $statusDetails['label']; } @endphp

{!! $subscription->name ?? $subscription->reference_id !!}

{{ $statusLabel }}

{{ __('subscription.Subscription ID') }}: #{{ $subscription->reference_id }} • {{ __('subscription.Active since') }} {{ $subscription->created_at->format('F d, Y') }}

{{-- Change Plan Button - Placeholder/Hidden for now --}} {{-- --}} @if($isCancelled && $expiryDate > now())
@csrf @method('PUT')
@endif @if(!$isCancelled && $isActive)
@csrf @method('PUT')
@endif

view_in_ar {{ __('subscription.Plan Configuration') }}

token

{!! $subscription->name !!}

{{ __('subscription.Base subscription fee') }}

{!! ch_format_price($subscription->price) !!} / {{ getConstantLabel('billing_cycle', $subscription->billing_cycle) }}
@if($subscription->addons && $subscription->addons->count() > 0)

{{ __('subscription.Recurring Add-ons') }}

@foreach($subscription->addons as $addon)
extension

{!! $addon->name !!}

{!! ch_format_price($addon->total_price) !!} / {{ getConstantLabel('billing_cycle', $subscription->billing_cycle) }}
@endforeach
@endif @if(isset($productFiles) && count($productFiles) && ($subscription->status == getConstant('SUBSCRIPTION_STATUS_ACTIVE') || $subscription->status == getConstant('SUBSCRIPTION_STATUS_TRIAL')))

download {{ __('subscription.Downloads & Files') }}

@foreach($productFiles as $productFile) @endforeach
{{ __('subscription.Version') }} {{ __('subscription.File') }}
{{ $productFile->version ?? 'N/A' }} @if($productFile->changelog) {{ $productFile->changelog }} @endif
    @if(!$productFile->support_expired) @foreach($productFile->getMedia('product_files') as $file)
  • cloud_download {{ $file->name }}
  • @endforeach @else
  • lock {{ __('subscription.Support expired on') }} {{ $productFile->support_expiry_date }}
  • @endif
@endif

history {{ __('subscription.Billing History') }}

@forelse($subscription->orders as $order) @empty @endforelse
{{ __('subscription.Date') }} {{ __('subscription.Order ID') }} {{ __('subscription.Amount') }} {{ __('subscription.Status') }}
{{ $order->created_at->format('F d, Y') }} #{{ $order->order_reference }} {!! ch_format_price($order->total, $order->currency) !!} @php $orderStatusClass = 'bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300'; if ($order->status == getConstant('ORDER_STATUS_PAID') || $order->status == getConstant('ORDER_STATUS_COMPLETED')) { $orderStatusClass = 'bg-green-50 text-green-700 dark:bg-green-900/20 dark:text-green-400'; } elseif ($order->status == getConstant('ORDER_STATUS_PENDING')) { $orderStatusClass = 'bg-orange-50 text-orange-700 dark:bg-orange-900/20 dark:text-orange-400'; } elseif ($order->status == getConstant('ORDER_STATUS_CANCELLED')) { $orderStatusClass = 'bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-400'; } @endphp {{ getConstantLabel('order_status', $order->status) }} arrow_forward
{{ __('subscription.No billing history found.') }}

{{ __('subscription.Upcoming Charge') }}

@if($isActive && !$isCancelled)
{{ __('subscription.Total') }} {!! ch_format_price($subscription->total_price) !!}
{{ __('subscription.Next Total') }} {{ __('subscription.Due') }} {{ $subscription->next_billing_date ? $subscription->next_billing_date->format('M d, Y') : 'N/A' }}
{!! ch_format_price($subscription->total_price) !!}
info

{{ __('subscription.Your next automatic renewal will happen in :days days.', ['days' => $subscription->next_billing_date ? ceil(now()->diffInDays($subscription->next_billing_date)) : 0]) }}

@else

{{ __('subscription.No upcoming charges.') }}

@endif @if(isset($lastOrder->billingInfo))

{{ __('subscription.Billing Address') }}

{{ $lastOrder->billingInfo->full_name_attribute ?? '' }}

{{ $lastOrder->billingInfo->address ?? '' }}

{{ $lastOrder->billingInfo->city ?? '' }} {{ $lastOrder->billingInfo->state->name ?? '' }} {{ $lastOrder->billingInfo->zip ?? '' }}

{{ $lastOrder->billingInfo->country->name ?? '' }}

@endif
@endsection