@extends('backend.partials.master') @section('title') {{ ___('menus.agent_wallet') }} @endsection @section('maincontent')
{{ ___('label.balance') }}

{{ currency_symbol() }}{{ number_format($balance, 2) }}

{{ ___('label.available_to_withdraw') }}

{{ currency_symbol() }}{{ number_format($available, 2) }}

{{ ___('label.balance_less_pending_requests') }}
{{ ___('label.withdrawn') }}

{{ currency_symbol() }}{{ number_format($withdrawn, 2) }}

{{ ___('label.commission_pending_approval') }}

{{ currency_symbol() }}{{ number_format($pending, 2) }}

{{-- Requesting is the agent's half of the settlement: the office approves and marks it paid, and only then does the wallet go down. --}}

{{ ___('label.request_a_withdrawal') }}

@if($available <= 0)

{{ str_replace([':amount'], [currency_symbol() . number_format($pending, 2)], ___('label.nothing_to_withdraw_hint')) }}

@else
@csrf
{{ ___('label.up_to') }} {{ currency_symbol() }}{{ number_format($available, 2) }} @error('amount') {{ $message }} @enderror
@error('method') {{ $message }} @enderror
@error('account_details') {{ $message }} @enderror
@endif

{{ ___('label.my_withdrawal_requests') }}

@forelse($withdrawals as $w) @php $badge = match($w->status) { 'paid' => 'success', 'approved' => 'info', 'rejected' => 'danger', default => 'warning', }; @endphp @empty @endforelse
{{ ___('label.reference') }}{{ ___('label.requested') }}{{ ___('label.amount') }}{{ ___('label.method') }}{{ ___('label.status') }}
{{ $w->reference }} {{ $w->requested_on?->translatedFormat('d M Y') }} {{ currency_symbol() }}{{ number_format($w->amount, 2) }} {{ admin_label($w->method) }} {{ admin_label(ucfirst($w->status)) }}
{{ ___('label.no_withdrawal_requests_yet') }}
@foreach($transactions as $t) @php $cls = $t->type === 'credit' ? 'success' : 'danger'; $sign = $t->type === 'credit' ? '+' : '-'; @endphp {{ $t->reference }} {{ $t->txn_date?->translatedFormat('d M Y') }} {{ $t->description }} {{ admin_label(ucfirst($t->type)) }} {{ $sign }}{{ currency_symbol() }}{{ number_format($t->amount, 2) }} {{ currency_symbol() }}{{ number_format($t->balance_after, 2) }} @endforeach
@endsection