@php use App\Finance\FinanceCopy; use App\Finance\Money; $seriesMax = max(1, collect($cards['series'])->max('value') ?: 1); $healthTotal = max(1, array_sum($cards['health'])); @endphp

{{ __('dashboard.Finance') }}

{{ __('dashboard.Revenue, collections, credit liability, and payment events.') }}

{{ __('dashboard.CSV') }} @if ($canAdvancedExport) {{ __('dashboard.TSV') }} {{ __('dashboard.JSON') }} @endif {{ $cards['month'] }} {{ $cards['currency'] }}
@include('livewire.dashboard.finance.options.nav')

{{ __('dashboard.Collected this month') }}

{{ Money::format($cards['collected'], $cards['currency']) }}

@include('livewire.dashboard.finance.partials.delta', ['delta' => $cards['collected_delta']]) {{ __('dashboard.vs last month') }}

{{ __('dashboard.MRR') }}

{{ Money::format($cards['mrr'], $cards['currency']) }}

{{ number_format($cards['active']) }} {{ __('dashboard.active subscriptions') }}

{{ __('dashboard.Active subscriptions, yearly divided by 12.') }}

{{ __('dashboard.Net after API') }}

{{ Money::format($cards['net'], $cards['currency']) }}

{{ __('dashboard.Collected :revenue · est. API :cost (:credits credits)', [ 'revenue' => Money::format($cards['collected'], $cards['currency']), 'cost' => Money::format($cards['api_usd'], $cards['currency']), 'credits' => number_format($cards['credits_burned']), ]) }}

{{ __('dashboard.Failed charges') }}

{{ number_format($cards['failed']) }}

@include('livewire.dashboard.finance.partials.delta', ['delta' => $cards['failed_delta']]) {{ __('dashboard.Failed invoices this month.') }}

{{ __('dashboard.Cancellations') }}

{{ number_format($cards['canceled']) }}

@include('livewire.dashboard.finance.partials.delta', ['delta' => $cards['canceled_delta']]) {{ __('dashboard.Canceled subscriptions this month.') }}

{{ __('dashboard.Credit liability') }}

{{ number_format($cards['credit_liability']) }}

{{ __('dashboard.Unused pack and grant credits.') }} @if ($cards['unlimited_holders'] > 0) · {{ __('dashboard.:count unlimited', ['count' => $cards['unlimited_holders']]) }} @endif

{{ __('dashboard.Collections by method') }}

@if (count($cards['mix']) === 0)

{{ __('dashboard.No collections this month.') }}

@else
@foreach ($cards['mix'] as $row)
{{ FinanceCopy::driver($row['driver']) }} {{ Money::format($row['amount'], $cards['currency']) }} · {{ $row['share'] }}%
@endforeach
@endif

{{ __('dashboard.Invoice health') }}

@foreach (['paid', 'open', 'failed', 'refunded'] as $key)

{{ __('dashboard.'.ucfirst($key)) }}

{{ number_format($cards['health'][$key]) }}

@endforeach

{{ __('dashboard.Recent invoices') }}

{{ __('dashboard.View all') }}
@if ($invoices->isEmpty())
{{ __('dashboard.No invoices yet. Checkout and invoice.paid webhooks land here.') }}
@else {{ __('dashboard.User') }} {{ __('dashboard.Amount') }} {{ __('dashboard.Status') }} @foreach ($invoices as $invoice) @php $tone = FinanceCopy::invoice($invoice->status); @endphp {{ $invoice->user?->name ?: __('dashboard.Unlinked') }}

{{ $invoice->plan?->title ?: FinanceCopy::driver($invoice->driver) }} · {{ $invoice->paid_at?->format('M j') ?: $invoice->created_at?->format('M j') }}

{{ $invoice->formattedAmount() }} {{ $tone['label'] }}
@endforeach
@endif

{{ __('dashboard.Recent events') }}

{{ __('dashboard.View all') }}
@if ($events->isEmpty())
{{ __('dashboard.No webhook events yet.') }}
@else {{ __('dashboard.Event') }} {{ __('dashboard.Status') }} @foreach ($events as $event) @php $tone = FinanceCopy::event($event->status); @endphp {{ $event->event_type }}

{{ FinanceCopy::driver($event->driver) }} · {{ $event->created_at?->format('M j, H:i') }}

{{ $tone['label'] }}
@endforeach
@endif

{{ __('dashboard.Recent grants') }}

{{ __('dashboard.View all') }}
@if ($grants->isEmpty())
{{ __('dashboard.No credit grants yet. Manual grants and top-ups appear here.') }}
@else {{ __('dashboard.User') }} {{ __('dashboard.Amount') }} {{ __('dashboard.Kind') }} {{ __('dashboard.Granted by') }} @foreach ($grants as $grant)

{{ $grant->user?->name ?: '—' }}

{{ $grant->reason ?: $grant->plan?->title }}

{{ $grant->amount > 0 ? '+'.$grant->amount : $grant->amount }} {{ FinanceCopy::creditKind($grant->kind) }} {{ $grant->actor?->name ?: '—' }}
@endforeach
@endif