@extends('layouts.app') @section('title', 'تفاصيل الطلب المالي') @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

تفاصيل الطلب

{{ $finRequest->status_label }}
الموظف {{ $finRequest->employee->first_name ?? '' }} {{ $finRequest->employee->last_name ?? '' }}
نوع الطلب {{ $finRequest->type_label }}
المبلغ {{ number_format($finRequest->amount, 2) }} {{ $finRequest->currency }}
تاريخ الطلب {{ $finRequest->created_at?->format('d/m/Y H:i') }}
@if($finRequest->description)
التفاصيل {{ $finRequest->description }}
@endif @if($finRequest->type === 'business_trip')
الوجهة {{ $finRequest->trip_destination ?? '—' }}
فترة الانتداب {{ $finRequest->trip_start_date?->format('d/m/Y') }} → {{ $finRequest->trip_end_date?->format('d/m/Y') }}
@endif @if($finRequest->rejection_reason)
سبب الرفض {{ $finRequest->rejection_reason }}
@endif
{{-- إجراءات الاعتماد --}} @if(in_array($finRequest->status, ['pending', 'manager_approved', 'hr_approved', 'finance_approved']))

إجراءات

@if(in_array($finRequest->status, ['pending', 'manager_approved', 'hr_approved']))
@csrf
@csrf
@endif @if($finRequest->status === 'finance_approved')
@csrf
@endif
@endif
{{-- مسار الاعتماد --}}

مسار الاعتماد

@php $steps = [ ['status' => 'pending', 'label' => 'تقديم الطلب', 'icon' => 'fa-paper-plane', 'done' => true], ['status' => 'manager_approved', 'label' => 'موافقة المدير', 'icon' => 'fa-user-tie', 'done' => in_array($finRequest->status, ['manager_approved','hr_approved','finance_approved','paid'])], ['status' => 'hr_approved', 'label' => 'موافقة HR', 'icon' => 'fa-users-cog', 'done' => in_array($finRequest->status, ['hr_approved','finance_approved','paid'])], ['status' => 'finance_approved', 'label' => 'موافقة المالية', 'icon' => 'fa-calculator', 'done' => in_array($finRequest->status, ['finance_approved','paid'])], ['status' => 'paid', 'label' => 'تم الصرف', 'icon' => 'fa-check-double', 'done' => $finRequest->status === 'paid'], ]; @endphp
@foreach($steps as $i => $step)
{{ $step['label'] }}
@endforeach
@endsection