{{-- ===================================================== Etebarit - by Gisoo Web Solutions ------------------------------------------------------ Gisoo.net ------------------------------------------------------ Copyright (c) 2026 Gisoo Web Solutions ===================================================== This code is protected by copyright ===================================================== File: show.blade.php ------------------------------------------------------ Use: Admin shop detail: an info tab (sales, wallet, recent transactions) and an edit tab that sets the merchant fee, identity and status. ===================================================== --}} @extends('layouts.admin') @section('title', $shop->name) @php use App\Support\Format; @endphp @section('breadcrumb') @endsection @section('page') @php $canManage = auth('admin')->user()->allowed('shops.manage'); @endphp {{ __('admin.shops_manage.back_to_list') }}
{{-- Header --}}
@if ($shop->logo_path) {{ $shop->name }} @else {{ mb_substr($shop->name, 0, 2) }} @endif
{{ $shop->name }}
{{ $shop->slug }}
@if ($shop->isApproved()) {{ __('admin.shops_manage.statuses.approved') }} @else {{ __('admin.shops_manage.statuses.rejected') }} @endif
{{-- Tabs --}}
@foreach (['info', 'edit'] as $key) @if ($key === 'edit' && ! $canManage) @continue @endif @endforeach
{{-- ===== Info tab ===== --}}
{{ __('admin.shops_manage.stats.settled') }}
@toman($settledTotal){{ __('admin.toman') }}
{{ __('admin.shops_manage.stats.wallet') }}
@toman($walletBalance){{ __('admin.toman') }}
{{ __('admin.shops_manage.stats.customers') }}
@fa($customers)
{{ __('admin.shops_manage.stats.fee') }}
@fa(Format::percentFromBp($shop->fee_percent))٪ — @toman((int) $shop->fee_cap)
{{ __('admin.shops_manage.owner') }}
@if ($shop->user) {{ $shop->user->fullName() }} @else — @endif
{{ __('admin.shops_manage.member_since') }}
@jalali($shop->created_at)
@php $loc = implode('، ', array_filter([$shop->province, $shop->city])); $fullAddress = $shop->address ? ($loc ? $loc.' — '.$shop->address : $shop->address) : $loc; @endphp @if ($fullAddress !== '')
{{ __('admin.shops_manage.address') }}
{{ $fullAddress }}
@endif

{{ __('admin.shops_manage.recent_sales') }}

{{ __('admin.actions.see_all') }}
@forelse ($transactions as $transaction) @php $incoming = $transaction->isIncoming(); @endphp
! $loop->first])>
{{ $transaction->primaryEntry()?->reasonLabel('admin.wallet_reasons') ?? __('admin.wallet_reasons.other') }}
@if ($transaction->order){{ $transaction->order->code }} • @endif{{ \App\Support\Format::jalaliDateTimeFa($transaction->created_at) }}
$incoming, 'text-secondary-500' => ! $incoming]) dir="ltr">{{ $incoming ? '+' : '−' }}@toman($transaction->amount)
@empty

{{ __('admin.shops_manage.no_transactions') }}

@endforelse
{{-- ===== Orders ===== --}}

{{ __('admin.shops_manage.orders.title') }}

{{ __('admin.actions.see_all') }}
@forelse ($orders as $order) @empty @endforelse
{{ __('admin.shops_manage.orders.code') }} {{ __('admin.shops_manage.orders.customer') }} {{ __('admin.shops_manage.orders.amount') }} {{ __('admin.shops_manage.orders.status') }} {{ __('admin.shops_manage.orders.date') }}
{{ $order->code }} {{ $order->user?->fullName() ?? '—' }} @toman($order->amount) {{ __('admin.toman') }} $order->isPaid(), 'bg-[#fff5e6] text-amber-600' => $order->isPending(), 'bg-secondary-50 text-secondary-500' => ! $order->isPaid() && ! $order->isPending(), ])>{{ __('admin.orders.statuses.'.$order->status) }} @jalaliDateTime($order->created_at)
{{ __('admin.shops_manage.orders.empty') }}
{{-- ===== Settlement requests ===== --}}

{{ __('admin.shops_manage.settlement.title') }}

{{ __('admin.actions.see_all') }}
@forelse ($settlements as $settlement) @php $account = $settlement->bankAccount; $card = $settlement->card_number ?: ($account?->card_number ?? ''); $sheba = $settlement->sheba ?: ($account?->sheba ?? ''); $payload = [ 'code' => Format::persianDigits($settlement->code), 'amount' => Format::tomanFa($settlement->amount), 'requester' => $shop->name, 'requesterUrl' => route('admin.shops.show', $shop), 'extras' => array_values(array_filter([ $shop->user ? ['label' => __('admin.settlements.owner'), 'value' => $shop->user->fullName(), 'ltr' => false, 'url' => route('admin.users.show', $shop->user)] : null, ])), 'bank' => $account?->bankName() ?? '', 'cardRaw' => $card, 'shebaRaw' => 'IR'.$sheba, 'accounts' => ($shop->user?->bankAccounts ?? collect()) ->where('status', \App\Models\BankAccount::STATUS_APPROVED) ->sortByDesc(fn ($a) => (int) ($a->id === $settlement->bank_account_id)) ->map(fn ($a) => ['card' => $a->card_number, 'sheba' => $a->sheba, 'label' => $a->bankName().' — '.Format::persianDigits($a->maskedCard())]) ->values()->all(), 'filedAt' => Format::jalaliDateTimeFa($settlement->created_at), 'decidedAt' => $settlement->decided_at === null ? '' : Format::jalaliDateTimeFa($settlement->decided_at), 'settledAt' => $settlement->settled_at === null ? '' : Format::jalaliDateTimeFa($settlement->settled_at), 'decidedBy' => $settlement->decidedBy?->name ?? '', 'reference' => Format::persianDigits($settlement->reference ?? ''), 'rejectReason' => $settlement->reject_reason ?? '', 'status' => $settlement->status, 'statusLabel' => __("admin.settlements.statuses.{$settlement->status}"), 'isPending' => $settlement->isPending(), 'isApproved' => $settlement->isApproved(), 'manageable' => $canManage, 'approveUrl' => route('admin.settlements.approve', $settlement), 'settleUrl' => route('admin.settlements.settle', $settlement), 'rejectUrl' => route('admin.settlements.reject', $settlement), 'confirmApprove' => __('admin.settlements.confirm_approve', ['code' => Format::persianDigits($settlement->code)]), 'confirmSettle' => __('admin.settlements.confirm_settle', ['code' => Format::persianDigits($settlement->code)]), 'confirmReject' => __('admin.settlements.confirm_reject', [ 'code' => Format::persianDigits($settlement->code), 'amount' => Format::persianDigits(Format::tomanFa($settlement->amount)), ]), ]; $badge = [ 'pending' => 'bg-[#fff5e6] text-amber-600', 'approved' => 'bg-[#eaf1ff] text-blue-600', 'settled' => 'bg-[#e7f7ee] text-green-600', 'rejected' => 'bg-[#f1f0f5] text-ink-muted', ][$settlement->status]; @endphp @empty @endforelse
{{ __('admin.shops_manage.settlement.code') }} {{ __('admin.shops_manage.settlement.amount') }} {{ __('admin.shops_manage.settlement.destination') }} {{ __('admin.shops_manage.settlement.status') }} {{ __('admin.shops_manage.settlement.date') }}
{{ $settlement->code }} @toman($settlement->amount) {{ $account?->bankName() ?? '—' }} @fa($account?->maskedCard()) {{ __("admin.shops_manage.settlement.statuses.{$settlement->status}") }} @jalaliDateTime($settlement->created_at)
{{ __('admin.shops_manage.settlement.empty') }}
{{-- ===== Two-phase review modal (shared) ===== --}} @include('admin.partials.payout-modal', ['lang' => 'admin.settlements'])
{{-- ===== Edit tab ===== --}} @if ($canManage)
@csrf @method('PUT')
{{-- Shown as a percent, stored as basis points (percent * 100). --}}
٪
{{ __('admin.toman') }}

{{ __('front.shop.info.support_phone_invalid') }}

{{ __('admin.shops_manage.fields.website_hint') }}

@endif
@endsection