{{-- ===================================================== Etebarit - by Gisoo Web Solutions ------------------------------------------------------ Gisoo.net ------------------------------------------------------ Copyright (c) 2026 Gisoo Web Solutions ===================================================== This code is protected by copyright ===================================================== File: installments.blade.php ------------------------------------------------------ Use: The user's installments. Rows show the plan name and the request tracking code only -- never a shop or a product. ===================================================== --}} @extends('layouts.user') @section('title', __('front.installments.title')) @section('breadcrumb') @endsection @section('page') @php $payConfig = [ 'balance' => $cashBalance, 'chargeUrl' => route('account.wallet'), 'strings' => [ 'confirmWallet' => __('front.installments.confirm_pay_wallet'), 'confirmOnline' => __('front.installments.confirm_pay_online'), 'confirmMixed' => __('front.installments.confirm_pay_mixed'), ], ]; @endphp

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

{{ __('front.installments.subtitle') }} {{ __('front.installments.wallet_balance', ['amount' => \App\Support\Format::persianDigits(\App\Support\Format::tomanFa($cashBalance))]) }}

{{-- ===== KPI summary cards ===== --}} @unless ($installments->isEmpty()) @php $kpis = [ ['key' => 'due', 'color' => 'text-secondary-500', 'bg' => 'bg-[#fdeaec]', 'stroke' => '#e80e23', 'icon' => ''], ['key' => 'upcoming', 'color' => 'text-amber-600', 'bg' => 'bg-[#fff5e6]', 'stroke' => '#d97706', 'icon' => ''], ['key' => 'paid', 'color' => 'text-green-600', 'bg' => 'bg-[#e7f7ee]', 'stroke' => '#16a34a', 'icon' => ''], ['key' => 'remaining', 'color' => 'text-ink', 'bg' => 'bg-[#efeafb]', 'stroke' => '#563bb1', 'icon' => ''], ]; @endphp
@foreach ($kpis as $kpi) @php $bucket = $summary[$kpi['key']]; @endphp
{!! $kpi['icon'] !!} {{ __('front.installments.summary.'.$kpi['key']) }}
@toman($bucket['amount'])
{{ __('front.installments.summary.'.($kpi['key'] === 'remaining' ? 'remaining_count' : 'count'), ['count' => \App\Support\Format::persianDigits((string) $bucket['count'])]) }}
@endforeach
@endunless @if ($installments->isEmpty())
{{ __('front.installments.empty') }}
@else
@foreach ($installments as $installment) @endforeach
{{ __('front.installments.columns.sequence') }} {{ __('front.installments.columns.plan') }} {{ __('front.installments.columns.due') }} {{ __('front.installments.columns.amount') }} {{ __('front.installments.columns.penalty') }} {{ __('front.installments.columns.status') }} {{ __('front.installments.columns_action') }}
@fa($installment->sequence) {{ __('front.installments.of') }} @fa($installment->creditRequest->plan->months) {{ $installment->creditRequest->plan->name }} {{ $installment->creditRequest->code }} @if ($installment->isSalaryBacked() && ! $installment->isPaid()) {{-- Paid by the organization and deducted from the payslip; never payable by the user directly. --}} {{ __('front.installments.salary_backed_note') }} @endif @jalali($installment->due_at) @toman($installment->amount) {{ __('front.credit.toman') }} @if ($installment->penalty_amount > 0) @toman($installment->penalty_amount) {{ __('front.credit.toman') }} @else @endif $installment->status === \App\Models\Installment::STATUS_UPCOMING, 'bg-[#fff5e6] text-amber-600' => $installment->status === \App\Models\Installment::STATUS_DUE, 'bg-secondary-50 text-secondary-500' => $installment->status === \App\Models\Installment::STATUS_OVERDUE, 'bg-[#e7f7ee] text-green-600' => $installment->status === \App\Models\Installment::STATUS_PAID, ])> {{ __("front.installments.statuses.{$installment->status}") }} @if ($installment->payableByUser()) @else @endif
@endif {{-- One hidden form the modal posts; its action is set to the chosen row. --}} {{-- ===== Pay modal ===== --}}
@endsection