{{-- Status pills + per-field search, in one bar (same as the owner) --}}
@foreach ($this->statuses() as $st) @php $count = $st === 'all' ? array_sum($counts) : ($counts[$st] ?? 0); @endphp @endforeach
@if ($isBusinessPlan) {{-- ── Business-plan reseller: full admin-style table (SERVICE ID, API SVC, etc.) ── --}} @forelse ($orders as $order) @php $stMap = [ 'awaiting' => ['warning', __('Awaiting')], 'pending' => ['warning', __('Pending')], 'processing' => ['info', __('Processing')], 'in_progress' => ['info', __('In progress')], 'active' => ['active', __('Active')], 'completed' => ['success', __('Completed')], 'partial' => ['partial', __('Partial')], 'canceled' => ['neutral', __('Canceled')], 'refunded' => ['refund', __('Refunded')], 'error' => ['danger', __('Error')], 'simulated' => ['danger', __('Simulated')], 'fail' => ['danger', __('Fail')], ]; [$stTone, $stLabel] = $stMap[$order->status] ?? ['neutral', ucfirst(str_replace('_', ' ', (string) $order->status))]; $detailPayload = [ 'id' => $order->id, 'status_tone' => $stTone, 'status_label' => $stLabel, 'created' => rf_datetime($order->created_at), 'client_name' => $order->user?->name ?? '—', 'client_email' => $order->user?->email ?? '', 'service' => $order->serviceName(), 'link' => $order->link ?: '—', 'quantity' => number_format($order->quantity), 'remains' => number_format($order->remains), 'start_count' => $order->start_counter !== null ? (string) $order->start_counter : '—', 'mode' => ucfirst((string) $order->mode), 'provider' => $order->provider?->name ?? __('Manual'), 'provider_order_id' => $order->provider_order_id ? (string) $order->provider_order_id : '—', 'note' => $order->note ?: '—', 'charge' => money($order->charge, $order->currency), ]; @endphp {{-- Order ID with copy button --}} {{-- Service ID (local DB) --}} {{-- Provider ID: upstream order ID --}} {{-- API Svc: upstream service ID + name --}} {{-- User --}} {{-- Link --}} {{-- Quantity --}} {{-- Cost (charge to client) --}} {{-- Start Counter --}} {{-- Created --}} {{-- API Response / Note --}} @empty @endforelse
{{ __('Order ID') }} {{ __('Service ID') }} {{ __('Provider ID') }} {{ __('API Svc') }} {{ __('User') }} {{ __('Link') }} {{ __('Qty') }} {{ __('Cost') }} {{ __('Count') }} {{ __('Created') }} {{ __('API Response') }} {{ __('Status') }} {{ __('Auto') }} {{ __('Action') }}
{{ $order->id }} {{ $order->service_id ?? '—' }} {{ $order->provider_order_id ?: '—' }}
{{ $order->api_service_id ?? '—' }}
@if ($order->api_service_id)
{{ \Illuminate\Support\Str::limit($order->serviceName(), 30) }}
@endif @if ($order->is_drip_feed) Drip-feed @endif
{{ $order->user?->name ?? '—' }}
{{ $order->user?->email }}
@if ($order->link) {{ \Illuminate\Support\Str::limit($order->link, 26) }} @else — @endif {{ number_format($order->quantity) }} {{ money($order->charge, $order->currency) }} {{ __('Count') }}: {{ $order->start_counter ?? 0 }}
{{ rf_date($order->created_at) }}
{{ rf_date($order->created_at, 'H:i:s') }}
@if ($order->note) {{ \Illuminate\Support\Str::limit($order->note, 22) }} @else — @endif @if ($order->mode === 'auto') API @endif @if ($canManage) @endif @if ($canRefund)
@endif @if ($canManage)
@endif
@else {{-- ── Free / Pro reseller: standard view (Client, Service, margin info) ── --}} {{ __('Quantity') }}{{ __('Cost') }} @forelse ($orders as $order) @php $stMap = [ 'awaiting' => ['warning', __('Awaiting')], 'pending' => ['warning', __('Pending')], 'processing' => ['info', __('Processing')], 'in_progress' => ['info', __('In progress')], 'active' => ['active', __('Active')], 'completed' => ['success', __('Completed')], 'partial' => ['partial', __('Partial')], 'canceled' => ['neutral', __('Canceled')], 'refunded' => ['refund', __('Refunded')], 'error' => ['danger', __('Error')], 'simulated' => ['danger', __('Simulated')], 'fail' => ['danger', __('Fail')], ]; [$stTone, $stLabel] = $stMap[$order->status] ?? ['neutral', ucfirst(str_replace('_', ' ', (string) $order->status))]; $detailPayload = [ 'id' => $order->id, 'status_tone' => $stTone, 'status_label' => $stLabel, 'created' => rf_datetime($order->created_at), 'client_name' => $order->user?->name ?? '—', 'client_email' => $order->user?->email ?? '', 'service' => $order->serviceName(), 'link' => $order->link ?: '—', 'quantity' => number_format($order->quantity), 'remains' => number_format($order->remains), 'start_count' => $order->start_counter !== null ? (string) $order->start_counter : '—', 'mode' => ucfirst((string) $order->mode), 'provider' => $order->provider?->name ?? __('Manual'), 'provider_order_id' => $order->provider_order_id ? (string) $order->provider_order_id : '—', 'note' => $order->note ?: '—', 'charge' => money($order->charge, $order->currency), ]; @endphp @empty @endforelse
{{ __('Order ID') }} {{ __('Service ID') }} {{ __('Client') }} {{ __('Service') }} {{ __('Link') }} {{ __('Count') }} {{ __('Created') }} {{ __('API Response') }} {{ __('Status') }} {{ __('Auto') }} {{ __('Action') }}
#{{ $order->id }} {{ $order->service_id ?? '—' }}
{{ $order->user?->name ?? '—' }}
{{ $order->user?->email }}
{{ \Illuminate\Support\Str::limit($order->serviceName(), 34) }}
@if ($order->is_drip_feed || $order->is_subscription) {{ $order->is_subscription ? __('Subscription') : __('Drip-feed') }} @endif
@if ($order->link) {{ \Illuminate\Support\Str::limit($order->link, 26) }} @else — @endif {{ number_format($order->quantity) }} {{ money($order->charge, $order->currency) }} {{ __('Count') }}: {{ $order->start_counter ?? 0 }}
{{ rf_date($order->created_at) }}
{{ rf_date($order->created_at, 'H:i:s') }}
@if ($order->note) {{ \Illuminate\Support\Str::limit($order->note, 22) }} @else — @endif @if ($order->mode === 'auto') API @endif @if ($canManage) @endif @if ($canRefund)
@endif @if ($canManage)
@endif
@endif
@if ($orders->hasPages())
{{ $orders->links() }}
@endif
{{-- Edit order status modal. Uses $wire directly (no @entangle) to avoid the Blade component-compiler ParseError triggered by x-admin.modal when combined with x-admin.kebab + @js() in the same @forelse loop. --}}

{{ __('Edit order status') }}

{{ __('Saving with "Canceled" will automatically refund the client.') }}

{{-- Set partial: only what was delivered is charged, the rest is refunded. --}}

{{ __('Enter how much was NOT delivered. That part is refunded to your client, and your own cost with the owner is unwound in the same proportion.') }}

@error('partialRemains')

{{ $message }}

@enderror
{{-- Order detail — 100% client-side. The eye action dispatches the row (already panel-scoped, so no foreign order can be shown), so open AND close are instant with no round-trip. Badge mirrors components/admin/status-badge. --}}

{{ __('Order') }} #

{{ __('Client') }}
{{ __('Service') }}
{{ __('Link') }}
{{ __('Quantity') }}
{{ __('Remaining') }}
{{ __('Start count') }}
{{ __('Mode') }}
{{ __('Provider') }}
{{ __('Provider Order ID') }}
{{ __('API Response') }}
{{-- Cost --}}
{{ __('Cost') }}