@php $isReadOnly = in_array($row->status, [ \App\Models\AccountingRequisition::STATUS_PAID, \App\Models\AccountingRequisition::STATUS_REJECTED, \App\Models\AccountingRequisition::STATUS_SENT_TO_TREASURY, ], true); $inModal = request()->header('Turbo-Frame') === 'loan-form-modal'; $canApprove = $row->status === \App\Models\AccountingRequisition::STATUS_PENDING && ! ($detail['is_draft'] ?? false); @endphp @unless ($inModal) Back to list @endunless @include('loan.accounting.partials.flash') @error('status')@enderror @error('requisition')@enderror @if ($canApprove)

Pending approval — review and approve or reject this requisition.

@csrf
@csrf
@endif
@include('loan.accounting.requisitions.partials.status-badge', [ 'label' => $detail['status_label'] ?? '—', 'tone' => $detail['status_tone'] ?? 'neutral', ])

{{ $detail['workflow_stage'] ?? 'Workflow not started' }} @if (($detail['pending_with'] ?? '—') !== '—') · Pending with {{ $detail['pending_with'] }} @endif

Payment:
{{ $detail['payment_status'] ?? '—' }}
Total:
{{ $detail['currency'] ?? 'KES' }} {{ number_format((float) ($detail['amount'] ?? 0), 2) }}
@if ($isReadOnly)
Requester

{{ $detail['requester'] ?? '—' }}

Branch

{{ $detail['branch'] ?? '—' }}

Department

{{ $detail['department'] ?? '—' }}

Request type

{{ $detail['request_type'] ?? '—' }}

Expense account

{{ $detail['expense_account'] ?? '—' }}

Expense for

{{ $detail['cost_center'] ?? '—' }}

Payee

{{ $detail['beneficiary_name'] ?? '—' }}

M-Pesa number

{{ $detail['beneficiary_phone'] ?? '—' }}

Pay by

{{ ($detail['payment_method'] ?? '') === 'mpesa' ? 'M-Pesa' : (($detail['payment_method'] ?? '—') === '—' ? '—' : str_replace('_', ' ', $detail['payment_method'])) }}

Justification

{{ $detail['justification'] ?? '—' }}

@if (! empty($detail['attachment']))
Attachment

File attached

@endif
@if (! empty($detail['line_items']))
@foreach ($detail['line_items'] as $item) @endforeach
Description Category Qty Unit Cost Total
{{ $item['description'] ?: '—' }} {{ $item['category'] ?: '—' }} {{ number_format((float) $item['qty'], 2) }} {{ number_format((float) $item['unit_cost'], 2) }} {{ number_format((float) $item['total'], 2) }}
@endif @if ($inModal) @endif @else @include('loan.accounting.requisitions.partials.form-body', [ 'formAction' => route('loan.accounting.requisitions.update', $row), 'formMethod' => 'patch', 'formTitle' => $row->reference ?: 'Requisition', 'row' => $row, 'detail' => $detail, 'filterOptions' => $filterOptions, 'currentUser' => $row->requestedByUser?->loadMissing('employee'), 'accountingRequisitionCustomFields' => $accountingRequisitionCustomFields ?? [], ]) @endif