{{ __('locale.menu.Subscriptions')}}

@if(isset($customer->customer->subscription) && $customer->customer->activeSubscription() !== null)

{!! __('locale.subscription.you_are_currently_subscribed_to_plan', [ 'plan' => $customer->customer->currentPlanName(), 'price' => \App\Library\Tool::format_price($customer->customer->activeSubscription()->plan->price, $customer->customer->activeSubscription()->plan->currency->format), 'remain' => \App\Library\Tool::formatHumanTime($customer->customer->subscription->current_period_ends_at), 'end_at' => \App\Library\Tool::formatDate($customer->customer->subscription->current_period_ends_at) ]) !!}

{!! __('locale.description.subscription_logs') !!}

@forelse ($customer->customer->subscription->getLogs() as $key => $log) @empty @endforelse
{{ __('locale.labels.created_at') }} {{ __('locale.labels.message') }}
{{ \App\Library\Tool::formatDateTime($log->created_at) }} {!! __('locale.subscription.log_' . $log->type, $log->getData()) !!}
{{ __('locale.datatables.no_results') }}
@forelse ($customer->customer->subscription->getTransactions() as $key => $invoice) @empty @endforelse
{{ __('locale.labels.created_at') }} {{ __('locale.labels.title') }} {{ __('locale.labels.amount') }} {{ __('locale.labels.status') }}
{{ \App\Library\Tool::formatDate($invoice->created_at) }} {!! $invoice->title !!} @if ($invoice->description)
{!! $invoice->description !!}
@endif
{{ $invoice->amount }} @if($invoice->status == 'failed')
@elseif($invoice->status == 'pending' || $invoice->status == 'plan_change' || $invoice->status == 'renew' )
@elseif($invoice->status == 'auto_charge')
@else
@endif
{{ str_replace('_', ' ', $invoice->status) }}
{{ __('locale.datatables.no_results') }}
@else
{!! __('locale.subscription.no_active_subscription') !!}
@endif