{{-- ===================================================== Etebarit - by Gisoo Web Solutions ------------------------------------------------------ Gisoo.net ------------------------------------------------------ Copyright (c) 2026 Gisoo Web Solutions ===================================================== This code is protected by copyright ===================================================== File: show.blade.php ------------------------------------------------------ Use: A single credit request's status page, ported from the approved design: the status hero (with the 48h fee countdown + pay action while awaiting fee) and the plan / collateral / request detail sections. Never names a shop or a product. ===================================================== --}} @extends('layouts.user') @section('title', __('front.credit.title')) @section('breadcrumb') @endsection @php use App\Models\CreditRequest; $plan = $creditRequest->plan; $status = $creditRequest->status; $awaitingFee = $creditRequest->isAwaitingFee() && ! $creditRequest->feeWindowExpired(); // A window that lapsed before the nightly job flipped the row still reads // as expired to the user. $displayStatus = ($status === CreditRequest::STATUS_APPROVED && $creditRequest->feeWindowExpired()) ? CreditRequest::STATUS_EXPIRED : $status; $visuals = [ CreditRequest::STATUS_PENDING => ['icon' => '⏳', 'bg' => '#fff5e6', 'color' => '#d97706'], CreditRequest::STATUS_APPROVED => ['icon' => '✓', 'bg' => '#e7f7ee', 'color' => '#16a34a'], CreditRequest::STATUS_ACTIVE => ['icon' => '✓', 'bg' => '#e7f7ee', 'color' => '#16a34a'], CreditRequest::STATUS_REJECTED => ['icon' => '✕', 'bg' => '#fdeaec', 'color' => '#e80e23'], CreditRequest::STATUS_EXPIRED => ['icon' => '✕', 'bg' => '#fdeaec', 'color' => '#e80e23'], ][$displayStatus]; // Snapshot at approval; before that, show the expected fee for the plan. $feeDisplay = $creditRequest->fee_amount > 0 ? $creditRequest->fee_amount : intdiv($creditRequest->amount * $plan->fee_percent, 10000); $perInstallment = intdiv($creditRequest->amount, max($plan->months, 1)); @endphp @section('page')

{{ __('front.credit.title') }}

{{ __('front.credit.subtitle') }}

{{-- ===== Status hero ===== --}}
{{ $visuals['icon'] }}

{{ __("front.credit.status.{$displayStatus}_title") }}

{{ __("front.credit.status.{$displayStatus}_desc") }}

{{-- While under review, watch for the operator's decision: reloads on change, plus a manual refresh. --}} @if ($status === CreditRequest::STATUS_PENDING)

{{ __('front.live_status.auto_hint') }}

{{ __('front.live_status.unchanged') }}

@endif {{-- 48h countdown + pay action, only while awaiting the fee --}} @if ($awaitingFee)
{{ __('front.credit.deadline_label') }}
@foreach (['h' => 'cd_hours', 'm' => 'cd_minutes', 's' => 'cd_seconds'] as $part => $label) @if ($part !== 'h') : @endif
{{ __("front.credit.{$label}") }}
@endforeach
{{ __('front.credit.expire_note') }}
@php $walletPortion = min($cashBalance, $feeDisplay); $shortfall = max(0, $feeDisplay - $cashBalance); $fa = fn (int $v) => \App\Support\Format::persianDigits(\App\Support\Format::tomanFa($v)); @endphp
{{ __('front.credit.wallet_balance', ['amount' => $fa($cashBalance)]) }}
@if ($cashBalance >= $feeDisplay) {{-- Wallet fully covers the fee: pay from wallet, or online. --}} @else @if ($cashBalance > 0)
{{ __('front.credit.mixed_hint', ['wallet' => $fa($walletPortion), 'online' => $fa($shortfall)]) }}
@endif {{-- Charge the wallet by the shortfall, then return here to pay. --}}
@csrf
@endif
@endif {{-- request summary --}}
{{ __('front.credit.tracking_code') }} {{ $creditRequest->code }}
{{ __('front.credit.summary_amount') }} @toman($creditRequest->amount) {{ __('front.credit.toman') }}
{{ __('front.credit.fee_label') }} @toman($feeDisplay) {{ __('front.credit.toman') }}
{{-- ===== Detail sections ===== --}}
{{ __('front.credit.plan_info') }}
{{ __('front.credit.summary_plan') }} {{ __('front.credit.summary_plan_months', [ 'plan' => $plan->name, 'months' => \App\Support\Format::persianDigits((string) $plan->months), ]) }}
{{ __('front.credit.summary_amount') }} @toman($creditRequest->amount) {{ __('front.credit.toman') }}
{{ __('front.credit.per_installment') }} @toman($perInstallment) {{ __('front.credit.toman') }}
{{ __('front.credit.fee_with_percent', ['percent' => \App\Support\Format::persianDigits(\App\Support\Format::percentFromBp($plan->fee_percent))]) }} @toman($feeDisplay) {{ __('front.credit.toman') }}
{{ __('front.credit.grace_period') }} {{ $plan->grace_days > 0 ? __('front.credit.grace_days', ['days' => \App\Support\Format::persianDigits((string) $plan->grace_days)]) : __('front.credit.grace_none') }}
{{ __('front.credit.late_penalty') }} {{ __('front.credit.penalty_monthly', ['percent' => \App\Support\Format::persianDigits(\App\Support\Format::percentFromBp($plan->penalty_percent))]) }}
{{ __('front.credit.collateral_section') }}
{{ __("front.credit.collaterals.{$creditRequest->collateral_type}") }}
@if ($creditRequest->organization)
{{ $creditRequest->organization->name }}
@endif
{{ __('front.credit.request_specs') }}
{{ __('front.credit.submitted_at') }} @jalaliDateTime($creditRequest->created_at)
@if ($creditRequest->activated_at)
{{ __('front.credit.activated_at') }} @jalaliDateTime($creditRequest->activated_at)
@endif @if ($firstDueAt)
{{ __('front.credit.installments_start') }} @jalali($firstDueAt)
@endif
{{-- ===== Transactions (wallet ledger) ===== --}}
{{ __('front.credit.transactions_section') }}
@if ($entries->isEmpty())

{{ __('front.credit.transactions_empty') }}

@else
@foreach ($entries as $entry) {{-- RTL reading order: the figure first, the unit after it. Only the signed number itself is an LTR run. --}} @endforeach
{{ __('front.credit.tx_columns.reason') }} {{ __('front.credit.tx_columns.code') }} {{ __('front.credit.tx_columns.date') }} {{ __('front.credit.tx_columns.amount') }}
{{ $entry->reasonLabel('front.credit.reasons') }} @if ($entry->bucket === \App\Models\WalletEntry::BUCKET_INSTALLMENT) {{ __('front.credit.bucket_installment') }} @endif {{ $entry->transaction?->code ?? '—' }} @jalaliDateTime($entry->created_at) {{ $entry->isCredit() ? '+' : '−' }}@toman($entry->amount) {{ __('front.credit.toman') }}
@endif
{{ __('front.credit.back_to_history') }}
@endsection