@extends('layouts.head_office_app') @section('title', 'Cases Overview') @section('sidebar') @include('layouts.company.sidebar') @endsection @section('sub-header') @endsection @section('content')

Cases Overview Dashboard

Monitor case distribution and workload across users

@if(!count($ho_users))
No Case Handlers Found

There are no case handlers with assigned cases in your head office.

@else

{{ count($ho_users) }}

Total Users

{{ $headOffice->cases->filter(function ($case) { return ($case->status !== 'closed' && $case->status !== 'waiting') && !$case->isArchived && !$case->requires_final_approval; })->count();}}

Total Open Cases

{{ $ho_users->sum(function($ho_user) { try { return $ho_user->all_user_assigned_task()->count(); } catch (Exception $e) { return 0; } }) }}

Total Assigned Tasks

{{ $ho_users->sum(function($ho_user) { try { return $ho_user->user->case_request_informations()->count(); } catch (Exception $e) { return 0; } }) }}

Pending Information

Overview
@foreach($ho_users as $index => $ho_user)
{{ $index + 1 }}
@if (isset($ho_user->user->logo)) {{ $ho_user->user->name }} @else
{{ implode('', array_map(function ($word) {return strtoupper($word[0]);}, explode(' ', $ho_user->user->name))) }}
@endif
{{ $ho_user->user->name }}
{{ $ho_user->user->position->name ?? 'Case Handler' }}
Open Cases {{ $ho_user->head_office_user_cases->where('is_hidden', false)->filter(function($case) { return $case->case->status !== 'closed'; })->count() }}
Tasks {{ $ho_user->all_user_assigned_task()->count() }}
Info Requests {{ $ho_user->user->case_request_informations()->count() }}
Final Approval {{ count($ho_user->head_office_user_final_cases()) }}
@endforeach
@endif
@endsection @section('top_bar_search') @endsection @section('case_manager_tabs') @endsection @section('styles') @endsection @section('scripts') @endsection