{{ __('Subscription & charges') }}

{{ __('What Bilipoa has billed this account, and what it was for.') }}

@if (! $reseller)
{{ __('This page shows a seller’s own subscription. The platform account is not billed.') }}
@else {{-- Plan / trial standing --}}
{{ __('Current plan') }}
@if ($reseller->plan)
{{ $reseller->plan->name }}
{{ $reseller->plan->priceLabel() }}
@elseif ($reseller->onTrial())
{{ __('Free trial') }}
{{ trans_choice('{0}Ends today|{1}:count day left|[2,*]:count days left', max($reseller->trialDaysLeft(), 0), ['count' => max($reseller->trialDaysLeft(), 0)]) }}
@else
{{ __('No plan') }}
{{ __('Trial has ended.') }}
@endif {{ $reseller->plan ? __('Change plan') : __('Choose a plan') }}
{{ __('Wallet balance') }}
{{ __('KSh') }} {{ number_format((float) $reseller->balance, 2) }}
{{ __('Invoices and SMS charges are settled from here.') }}
{{ __('Account status') }}
@if ($reseller->status === 'suspended')
{{ __('Suspended') }}
{{ $reseller->suspension_reason === 'invoice_overdue' ? __('Unpaid invoice.') : __('No plan chosen after trial.') }}
@else
{{ __('Active') }}
@endif
{{-- Subscription invoices --}}
{{ __('Subscription invoices') }}
@if ($invoices->isEmpty())

{{ __('No invoices yet. The first one is raised after your first full billing month.') }}

@else
@foreach ($invoices as $invoice) @endforeach
{{ __('Period') }} {{ __('Plan') }} {{ __('Usage billed') }} {{ __('Amount') }} {{ __('Status') }}
{{ $invoice->period_start->format('d M') }} – {{ $invoice->period_end->format('d M Y') }} {{ $invoice->plan?->name ?? '—' }} @if ($invoice->usage_amount !== null) {{ __('KSh :amount hotspot revenue', ['amount' => number_format((float) $invoice->usage_amount, 2)]) }} @elseif ($invoice->usage_count !== null) {{ trans_choice(':count subscriber|:count subscribers', $invoice->usage_count, ['count' => $invoice->usage_count]) }} @else — @endif {{ number_format((float) $invoice->total_due, 2) }} @php $badge = match ($invoice->status) { 'paid' => 'bg-success-subtle text-success', 'overdue' => 'bg-danger-subtle text-danger', 'void' => 'bg-secondary-subtle text-secondary', default => 'bg-warning-subtle text-warning', }; @endphp {{ ucfirst($invoice->status) }} @if ($invoice->status === 'pending')
{{ __('Due :date', ['date' => $invoice->due_at->format('d M')]) }}
@endif
{{ $invoices->links() }}
@endif
{{-- SMS spend --}}
{{ __('SMS spend') }}
{{ $monthLabel }}
{{ __('Billed messages') }}
{{ $smsTotals['charged'] }}
{{ __('via Bilipoa SMS, at KSh :fee each', ['fee' => number_format($perSmsFee ?? 0.5, 2)]) }}
{{ __('Free messages') }}
{{ $smsTotals['free'] }}
{{ __('sent on your own gateway account') }}
{{ __('Charged this month') }}
{{ __('KSh') }} {{ number_format($smsTotals['cost'], 2) }}
{{ __('already deducted from your wallet') }}
@if ($smsTotals['charged'] === 0 && $smsTotals['free'] === 0)

{{ __('No messages sent in this month.') }}

@else

{{ __('Switch to your own gateway on the SMS gateway page to stop per-message charges.') }} {{ __('SMS gateway settings') }}

@endif
@endif