{{-- Status pills + search in one bar --}}
{{-- Pills (scrollable) --}}
@foreach ($this->statuses() as $st) @endforeach
{{-- Search (fixed right): input first, then field selector --}}
@forelse ($orders as $order) @php $stMap = [ 'awaiting' => ['pending', __('Pending')], 'pending' => ['pending', __('Pending')], 'processing' => ['progress', __('Processing')], 'in_progress' => ['progress', __('In progress')], 'active' => ['active', __('Active')], 'completed' => ['done', __('Completed')], 'partial' => ['partial', __('Partial')], 'canceled' => ['canceled', __('Canceled')], 'refunded' => ['refunded', __('Refunded')], 'error' => ['error', __('Error')], 'simulated' => ['error', __('Simulated')], 'fail' => ['error', __('Fail')], ]; [$stTone, $stLabel] = $stMap[$order->status] ?? ['neutral', ucfirst(str_replace('_', ' ', (string) $order->status))]; // Keep detail payload for client-side modal (no round-trip). $detailPayload = [ 'id' => $order->id, 'status_tone' => match($stTone) { 'pending' => 'warning', 'progress' => 'info', 'active' => 'active', 'done' => 'success', 'partial' => 'partial', 'canceled' => 'neutral', 'refunded' => 'refund', default => 'danger', }, 'status_label' => $stLabel, 'user' => $order->user?->email ?? '—', 'service' => $order->serviceName(), 'link' => $order->link, 'quantity' => number_format($order->quantity), 'remains' => number_format($order->remains), 'charge' => money($order->charge, $order->currency), 'cost' => money($order->cost, $order->currency), 'profit' => money($order->profit, $order->currency), 'provider' => $order->provider?->name ?? __('Manual'), 'provider_order_id'=> $order->provider_order_id ? (string) $order->provider_order_id : '—', 'created' => rf_datetime($order->created_at), 'is_drip_feed' => (bool) $order->is_drip_feed, 'runs' => (int) ($order->runs ?? 0), 'interval_minutes' => (int) ($order->interval_minutes ?? 0), 'drip_quantity' => (int) ($order->drip_quantity ?? 0), ]; @endphp {{-- Order ID --}} {{-- Service ID (our DB id) --}} {{-- Provider Order ID --}} {{-- API Service ID (upstream provider service ID) + name --}} {{-- Panel / Reseller --}} {{-- User --}} {{-- Link --}} {{-- Quantity --}} {{-- Cost (what the panel pays the provider) --}} {{-- Start Counter --}} {{-- Created --}} {{-- API Response / note --}} {{-- Status pill (solid color, like the reference panel design) --}} {{-- Auto / mode --}} {{-- Action --}} @empty @endforelse
{{ __('Order ID') }} {{ __('Service ID') }} {{ __('Provider ID') }} {{ __('API Svc') }} {{ __('Panel') }} {{ __('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)
{{ $order->serviceName() }}
@endif @if ($order->is_drip_feed) Drip-feed @endif
@if ($order->panel && $order->panel_id !== current_panel()?->id) {{ $order->panel->name }} @else — @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->cost, $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 ($stTone === 'canceled') ✕ @endif {{ $stLabel }} @if ($order->mode === 'auto') API @endif {{-- Only offered where it can actually work. The service re-checks every rule anyway; hiding it here keeps support from clicking something that always fails. --}} @if ($order->refill_enabled && $order->status === 'completed') @endif
@if ($orders->hasPages())
{{ $orders->links() }}
@endif
{{-- Edit order modal (status only — no price or quantity changes) --}}
@error('editStatus')

{{ $message }}

@enderror @if ($editStatus === 'canceled')

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

@endif
@error('editNote')

{{ $message }}

@enderror
{{-- Set partial modal --}}

{{ __('Enter the remaining (undelivered) quantity. The client is refunded for it proportionally.') }}

@error('partialRemains')

{{ $message }}

@enderror
{{-- Order details modal (100% client-side — no round-trip on open) --}}

{{ __('Order details') }}

{{ __('Order ID') }}
#
{{ __('Status') }}
{{ __('User') }}
{{ __('Service') }}
{{ __('Link') }}
{{ __('Quantity') }}
{{ __('Remains') }}
{{ __('Charge') }}
{{ __('Cost') }}
{{ __('Profit') }}
{{ __('Provider') }}
{{ __('Provider Order ID') }}
{{ __('Created') }}