{{-- ===================================================== Etebarit - by Gisoo Web Solutions ------------------------------------------------------ Gisoo.net ------------------------------------------------------ Copyright (c) 2026 Gisoo Web Solutions ===================================================== This code is protected by copyright ===================================================== File: index.blade.php ------------------------------------------------------ Use: The withdrawal queue. Pending requests come first; the review modal carries the destination account in full and either records the deposit reference or returns the money to the user. ===================================================== --}} @extends('layouts.admin') @section('title', __('admin.withdrawals.title')) @section('breadcrumb') @endsection @section('page') @php $canManage = auth('admin')->user()->allowed('withdrawals.manage'); @endphp

{{ __('admin.withdrawals.title') }}

{{ __('admin.withdrawals.subtitle') }}

{{ __('admin.withdrawals.info') }}
@foreach (__('admin.withdrawals.filters') as $key => $label) $status === $key, 'text-ink-muted hover:text-primary-600' => $status !== $key, ])>{{ $label }} @endforeach
@if ($status !== 'all') @endif
@forelse ($withdrawals as $withdrawal) @php $account = $withdrawal->bankAccount; // The confirmed destination once decided, else the account's own. $card = $withdrawal->card_number ?: ($account?->card_number ?? ''); $sheba = $withdrawal->sheba ?: ($account?->sheba ?? ''); $payload = [ 'code' => \App\Support\Format::persianDigits($withdrawal->code), 'amount' => \App\Support\Format::tomanFa($withdrawal->amount), 'requester' => $withdrawal->user?->fullName() ?? '', 'requesterUrl' => $withdrawal->user ? route('admin.users.show', $withdrawal->user) : '', 'extras' => array_values(array_filter([ $withdrawal->user ? ['label' => __('admin.withdrawals.mobile'), 'value' => \App\Support\Format::persianDigits($withdrawal->user->mobile), 'ltr' => true] : null, $withdrawal->user?->national_id ? ['label' => __('admin.withdrawals.national_id'), 'value' => \App\Support\Format::persianDigits($withdrawal->user->national_id), 'ltr' => true] : null, ])), 'bank' => $account?->bankName() ?? '', 'cardRaw' => $card, 'shebaRaw' => 'IR'.$sheba, 'accounts' => ($withdrawal->user?->bankAccounts ?? collect()) ->sortByDesc(fn ($a) => (int) ($a->id === $withdrawal->bank_account_id)) ->map(fn ($a) => ['card' => $a->card_number, 'sheba' => $a->sheba, 'label' => $a->bankName().' — '.\App\Support\Format::persianDigits($a->maskedCard())]) ->values()->all(), 'filedAt' => \App\Support\Format::jalaliDateTimeFa($withdrawal->created_at), 'decidedAt' => $withdrawal->decided_at === null ? '' : \App\Support\Format::jalaliDateTimeFa($withdrawal->decided_at), 'settledAt' => $withdrawal->settled_at === null ? '' : \App\Support\Format::jalaliDateTimeFa($withdrawal->settled_at), 'decidedBy' => $withdrawal->decidedBy?->name ?? '', 'reference' => \App\Support\Format::persianDigits($withdrawal->reference ?? ''), 'rejectReason' => $withdrawal->reject_reason ?? '', 'status' => $withdrawal->status, 'statusLabel' => __("admin.withdrawals.statuses.{$withdrawal->status}"), 'isPending' => $withdrawal->isPending(), 'isApproved' => $withdrawal->isApproved(), 'manageable' => $canManage, 'approveUrl' => route('admin.withdrawals.approve', $withdrawal), 'settleUrl' => route('admin.withdrawals.settle', $withdrawal), 'rejectUrl' => route('admin.withdrawals.reject', $withdrawal), 'confirmApprove' => __('admin.withdrawals.confirm_approve', ['code' => \App\Support\Format::persianDigits($withdrawal->code)]), 'confirmSettle' => __('admin.withdrawals.confirm_settle', ['code' => \App\Support\Format::persianDigits($withdrawal->code)]), 'confirmReject' => __('admin.withdrawals.confirm_reject', [ 'code' => \App\Support\Format::persianDigits($withdrawal->code), 'amount' => \App\Support\Format::persianDigits(\App\Support\Format::tomanFa($withdrawal->amount)), ]), ]; @endphp @empty @endforelse
{{ __('admin.withdrawals.columns.code') }} {{ __('admin.withdrawals.columns.user') }} {{ __('admin.withdrawals.columns.account') }} {{ __('admin.withdrawals.columns.amount') }} {{ __('admin.withdrawals.columns.date') }} {{ __('admin.withdrawals.columns.status') }} {{ __('admin.withdrawals.columns.actions') }}
@fa($withdrawal->code) @if ($withdrawal->user) {{ $withdrawal->user->fullName() }} @fa($withdrawal->user->mobile) @else @endif {{ $account?->bankName() }} @fa($account?->maskedCard()) @toman($withdrawal->amount) {{ __('admin.toman') }} @jalaliDateTime($withdrawal->created_at) $withdrawal->status === \App\Models\Withdrawal::STATUS_PENDING, 'bg-[#eaf1ff] text-blue-600' => $withdrawal->status === \App\Models\Withdrawal::STATUS_APPROVED, 'bg-[#e7f7ee] text-green-600' => $withdrawal->status === \App\Models\Withdrawal::STATUS_SETTLED, 'bg-secondary-50 text-secondary-500' => $withdrawal->status === \App\Models\Withdrawal::STATUS_REJECTED, ])>{{ __("admin.withdrawals.statuses.{$withdrawal->status}") }} {{ __('admin.withdrawals.review') }}
{{ $search !== '' ? __('admin.withdrawals.empty') : __("admin.withdrawals.empty_filtered.{$status}") }}
@if ($withdrawals->hasPages())
{{ $withdrawals->links() }}
@endif {{-- ===== Two-phase review modal (shared) ===== --}} @include('admin.partials.payout-modal', ['lang' => 'admin.withdrawals'])
@endsection