@extends('layouts.app') @section('title', $isTypist ? 'My Tasks' : 'Tasks & Approvals') @section('content')
@include('tenant.partials.typist-page-nav')
{{ $isTypist ? 'Personal worklist' : 'Controlled operational work' }}

{{ $isTypist ? 'My Tasks' : 'Tasks & Approval Center' }}

{{ $isTypist ? 'Only work assigned to you is shown here. Update progress as you complete each customer action.' : 'Assign accountable work and retain an auditable decision trail for sensitive exceptions.' }}

@if(auth()->user()->hasPermission('approvals.view'))@endif @if(auth()->user()->hasPermission('tasks.manage'))@endif
@php $openCount = ($taskCounts['open'] ?? 0) + ($taskCounts['in_progress'] ?? 0) + ($taskCounts['waiting'] ?? 0); @endphp @foreach([ ['Open work', $openCount, 'bg-sky-100 text-sky-700'], ['Overdue', $overdueTasks, 'bg-red-100 text-red-700'], ['Completed', $taskCounts['completed'] ?? 0, 'bg-emerald-100 text-emerald-700'], ] as [$label, $value, $tone])
{{ $label }}
{{ number_format($value) }}
@endforeach @if(auth()->user()->hasPermission('approvals.view'))
Pending approvals
{{ number_format($approvalCounts['pending'] ?? 0) }}
@endif
@if(auth()->user()->hasPermission('tasks.manage'))

Create {{ $isTypist ? 'a personal' : 'an operational' }} task

Add a clear action, deadline and linked record.

@csrf @unless($isTypist) @endunless
@endif
Reset

{{ $isTypist ? 'Assigned to me' : 'Task board' }}

Priority-sorted actions with accountable ownership and due dates.

@forelse($tasks as $task) @php $overdue = $task->due_at?->isPast() && !in_array($task->status, ['completed','cancelled']); $priorityTone = in_array($task->priority, ['urgent','critical']) ? 'bg-red-100 text-red-700' : ($task->priority === 'high' ? 'bg-orange-100 text-orange-700' : 'bg-slate-100 text-slate-600'); @endphp @empty @endforelse
TaskPriorityLinked workOwnerDueStatus / action
{{ $task->task_number }} · {{ $task->title }}{{ str($task->description)->limit(95) }}{{ $task->priority }}{{ $task->source_type ? str($task->source_type)->title() : 'General' }}{{ $task->source_id ? '#'.$task->source_id : ($task->branch?->name ?? 'No linked record') }}{{ $task->assignedUser?->name ?? 'Unassigned' }}Created by {{ $task->creator?->name ?? 'System' }}{{ $task->due_at?->format('d M Y, h:i A') ?? 'No deadline' }}@if($task->due_at){{ $task->due_at->diffForHumans() }}@endif@if(auth()->user()->hasPermission('tasks.manage') && !in_array($task->status, ['completed','cancelled']))
@csrf
@else{{ str($task->status)->replace('_',' ') }}@endif
No assigned tasksYour workflow tasks and renewal follow-ups will appear here.
@if($tasks->hasPages())
{{ $tasks->links() }}
@endif
@if(auth()->user()->hasPermission('approvals.view'))

Request approval

Submit exceptions for an authorized decision.

@csrf

Approval inbox

Permission-controlled decisions with permanent audit history.

@forelse($approvals as $approval)@empty@endforelse
RequestType / amountRequested byReasonStatusDecision
{{ $approval->approval_number }}{{ $approval->created_at->format('d M Y, h:i A') }}{{ str($approval->type)->replace('_',' ')->title() }}{{ $approval->amount !== null ? 'AED '.number_format((float) $approval->amount, 2) : 'No amount' }}{{ $approval->requester?->name }}{{ str($approval->reason)->limit(110) }}{{ $approval->status }}@if(auth()->user()->hasPermission('approvals.manage') && $approval->status === 'pending')
Review
@csrf
@else{{ $approval->decision_notes ?: 'No action' }}@endif
No approval requests.
@if($approvals->hasPages())
{{ $approvals->links() }}
@endif
@endif
@endsection