{{-- ===================================================== 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 user's wallet, from the approved design: the balance banner, the ledger with its in/out filter, the withdrawal modal and the recent requests. ===================================================== --}} @extends('layouts.user') @section('title', __('front.wallet.title')) @section('breadcrumb') @endsection @section('page') @php $accountOptions = $accounts->map(fn ($account) => [ 'id' => $account->id, 'bank' => $account->bankName(), 'card' => \App\Support\Format::persianDigits($account->maskedCard()), 'isDefault' => $account->is_default, ])->values(); @endphp @php $walletConfig = [ 'balance' => $withdrawable, 'minimum' => $minimum, 'topupMinimum' => 1000, 'accounts' => $accountOptions, 'blocked' => $pendingWithdrawal !== null, 'strings' => [ 'confirmWithdraw' => __('front.wallet.withdraw_confirm'), 'confirmTopup' => __('front.wallet.topup_confirm'), ], ]; @endphp

{{ $showSwitcher ? __('front.wallet.title_personal') : __('front.wallet.title') }}

{{ $showSwitcher ? __('front.wallet.subtitle_personal') : __('front.wallet.subtitle') }}

@if ($showSwitcher) @endif {{-- ===== Balance banner + actions ===== --}}
{{ __('front.wallet.cash_balance') }}
@toman($cashBalance) {{ __('front.wallet.toman') }}
{{ __('front.wallet.credited_total') }}
@toman($creditedTotal)
{{ __('front.wallet.spent_total') }}
@toman($spentTotal)
{{ __('front.wallet.withdrawn_total') }}
@toman($withdrawnTotal)
@if ($installmentBalance > 0)
{{ __('front.wallet.installment_balance') }}
@toman($installmentBalance)
@endif
@if ($installmentBalance > 0)

{{ __('front.wallet.installment_note') }}

@endif
{{-- ===== Ledger ===== --}}
{{ __('front.wallet.ledger') }}
@foreach (__('front.wallet.directions') as $key => $label) $direction === $key, 'text-ink-muted hover:text-primary-600' => $direction !== $key, ])>{{ $label }} @endforeach
@forelse ($entries as $entry) @php $incoming = $entry->isCredit(); @endphp @empty @endforelse
{{ __('front.wallet.columns.reason') }} {{ __('front.wallet.columns.bucket') }} {{ __('front.wallet.columns.date') }} {{ __('front.wallet.columns.amount') }} {{ __('front.wallet.columns.balance') }}
$incoming, 'bg-secondary-50 text-secondary-500' => ! $incoming, ])> @if ($incoming) @else @endif {{ $entry->reasonLabel('front.credit.reasons') }}
{{ __("front.transactions.buckets.{$entry->bucket}") }} @jalaliDateTime($entry->created_at) $incoming, 'text-secondary-500' => ! $incoming, ])> {{ $incoming ? '+' : '−' }}@toman($entry->amount) {{ __('front.wallet.toman') }} @toman($entry->balance_after) {{ __('front.wallet.toman') }}
{{ $direction === 'all' ? __('front.wallet.empty') : __("front.wallet.empty_{$direction}") }}
@if ($entries->hasPages())
{{ $entries->links() }}
@endif
{{-- ===== Withdrawal requests ===== --}}
{{ __('front.wallet.withdrawals') }}
@forelse ($withdrawals as $withdrawal) @empty @endforelse
{{ __('front.wallet.withdrawal_columns.code') }} {{ __('front.wallet.withdrawal_columns.account') }} {{ __('front.wallet.withdrawal_columns.amount') }} {{ __('front.wallet.withdrawal_columns.date') }} {{ __('front.wallet.withdrawal_columns.status') }}
@fa($withdrawal->code) {{ $withdrawal->bankAccount?->bankName() }} @fa($withdrawal->bankAccount?->maskedCard()) @toman($withdrawal->amount) {{ __('front.wallet.toman') }} @jalaliDateTime($withdrawal->created_at) $withdrawal->status === \App\Models\Withdrawal::STATUS_PENDING, 'bg-[#eef0fb] text-primary-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, ])>{{ __("front.wallet.withdrawal_statuses.{$withdrawal->status}") }} @if ($withdrawal->reference !== null) {{ __('front.wallet.withdrawal_reference') }}: @fa($withdrawal->reference) @endif @if ($withdrawal->reject_reason !== null) {{ __('front.wallet.withdrawal_reject_reason') }}: {{ $withdrawal->reject_reason }} @endif
{{ __('front.wallet.withdrawals_empty') }}
{{-- ===== Withdrawal modal ===== --}} {{-- ===== Top-up modal ===== --}} {{-- Shared add-account dialog: opened from the withdraw modal's "add another account" link via the open-add-account event. --}} @include('account.bank-accounts._add-modal')
@endsection