@extends('layouts.portal') @section('title', 'Will Management') @section('page_title', 'Will Management') @section('page_subtitle', 'Manage client wills') @section('sidebar') @include('agent.partials.sidebar', ['active' => 'wills']) @endsection {{-- Helper function to safely count values --}} @php if (!function_exists('safeCount')) { function safeCount($value) { if (is_array($value) || ($value instanceof Countable)) { return count($value); } return 0; } } @endphp @section('content')
Total Wills
Pending Review
Drafting
Completed
| Will ID | Client | Will Type | Status | Created | Actions |
|---|---|---|---|---|---|
| #{{ $will->id }} |
{{ $will->client ? strtoupper(substr($will->client->full_name, 0, 1)) : '?' }}
{{ $will->client ? $will->client->full_name : 'Unknown Client' }} {{ $will->client ? $will->client->email : 'No email' }} |
@if($isItATrust) {{ ucfirst($will->trust_type ?? 'Trust') }} @else {{ ucfirst($will->will_type) }} @endif |
@if($will->status == 'corrections_requested')
Corrections Requested
@else
{{ ucfirst(str_replace('_', ' ', $will->status)) }}
@endif
@if($will->status == 'corrections_requested' && $will->corrections_remarks)
{{ Str::limit($will->corrections_remarks, 50) }}
@endif
|
{{ $will->created_at->format('M d, Y') }} |
{{ round($progressPercentage) }}%
{{ $completedSections }}/{{ $totalSections }}
@if($completedSections == $totalSections)
Complete
@endif
Current Version: v{{ $will->version ?? 1 }} |
Last Updated: {{ $will->updated_at->format('M d, Y') }}
@if($completedSections == 0)
{{-- Trust not started yet --}}
Start with Trust Creator Details →
@elseif($completedSections < $totalSections)
{{-- Trust in progress --}}
Continue Trust Creation
@else
{{-- Trust completed but not submitted yet --}}
@endif
@endif
@elseif(in_array($will->status, ['drafting', 'draft']))
@if($completedSections == 0)
@if($will->will_type === 'islamic' || $will->will_type === 'islamic_will')
Start with Islamic Information →
@else
Start with Testator Information →
@endif
@elseif($completedSections < $totalSections)
@else
Corrections Required
@if($will->corrections_remarks)
{{ $will->corrections_remarks }} @endif
@if($will->will_type === 'islamic' || $will->will_type === 'islamic_will')
Edit Corrections
@else
Edit Corrections
@endif
View Will (v{{ $will->version ?? 1 }})
@if($will->will_type === 'islamic' || $will->will_type === 'islamic_will')
Edit Islamic Will
@else
Edit Will
@endif
Current Version: v{{ $will->version ?? 1 }} |
Last Updated: {{ $will->updated_at->format('M d, Y') }}
@if($isItATrust)
@else
@endif
@endif
@else
{{ ucfirst(str_replace('_', ' ', $will->status)) }}
@endif
|
| No wills found | |||||