@extends('layouts.billing') @section('title', __('billing.BillingHistory')) @section('content')

{{ __('billing.BillingAndInvoices') }}

{{ __('billing.ViewSubscriptionAndHistory') }}

{{-- Current subscription --}} @if($subscription)

{{ $subscription->plan->name ?? 'N/A' }}

{{ ucfirst($subscription->billing_cycle) }} · ${{ number_format($subscription->amount, 2) }}/{{ $subscription->billing_cycle === 'yearly' ? __('billing.Year') : __('billing.Month') }}

@php $statusClass = match($subscription->status) { 'active' => 'badge-active', 'pending' => 'badge-pending', 'cancelled' => 'badge-cancelled', 'expired', 'failed' => 'badge-expired', default => 'badge-pending', }; @endphp {{ ucfirst($subscription->status) }} @if($subscription->isActive() && $subscription->ends_at) @if($subscription->daysRemaining() <= 7) @endif {{ __('billing.Renews') }} {{ $subscription->ends_at->format('M d, Y') }} ({{ $subscription->daysRemaining() }} {{ __('billing.Days') }}) @endif @if($subscription->isActive()) {{ __('billing.ChangePlan') }} @else {{ __('billing.Subscribe') }} @endif
@else

{{ __('billing.NoActiveSubscription') }}

{{ __('billing.ChooseAPlan') }}
@endif {{-- Payment history --}}
{{ __('billing.PaymentHistory') }} {{ $payments->total() }} {{ __('billing.Transactions') }}
@if($payments->count() > 0)
@foreach($payments as $payment) @endforeach
{{ __('billing.Invoice') }} {{ __('billing.Plan') }} {{ __('billing.Amount') }} {{ __('billing.Gateway') }} {{ __('billing.Status') }} {{ __('billing.Date') }}
{{ $payment->invoice_number ?? '—' }} {{ $payment->plan->name ?? 'N/A' }} ({{ ucfirst($payment->billing_cycle) }}) {{ $currencySymbol }}{{ number_format($payment->amount, 2) }} {{ $payment->currency }} {{ $payment->gateway_label }} @php $badgeClass = match($payment->status) { 'paid' => 'badge-paid', 'pending' => 'badge-pending', 'failed' => 'badge-failed', 'refunded' => 'badge-refunded', default => 'badge-pending', }; @endphp {{ ucfirst($payment->status) }} {{ $payment->created_at->format('M d, Y') }} @if($payment->status === 'failed')
@csrf
@endif
@if($payments->hasPages())
{{ $payments->links() }}
@endif @else

{{ __('billing.NoPaymentRecords') }}

@endif
@endsection