@extends('layouts.app') @section('title', 'Leave Balance Report') @section('content')

Leave Balance Report

{{-- Filters --}}
Clear
{{-- Report Table --}}
Leave Balance for Year {{ $year }}
@forelse($leaveBalances as $employeeBalance) @foreach($employeeBalance['balances'] as $index => $balance) @php $usagePercentage = $balance['total_quota'] > 0 ? ($balance['used_days'] / $balance['total_quota'] * 100) : 0; @endphp @if($index === 0) @endif @endforeach @empty @endforelse
Employee Department Leave Type Total Quota Used Days Remaining Days Usage % Status
{{ strtoupper(substr($employeeBalance['employee']->name ?? 'N', 0, 1)) }}
{{ $employeeBalance['employee']->name ?? 'Unknown' }}
{{ $employeeBalance['employee']->contract?->position?->department?->department_name ?? '-' }} {{ $balance['leave_type'] }} {{ number_format($balance['total_quota'], 1) }} days {{ number_format($balance['used_days'], 1) }} days {{ number_format($balance['remaining_days'], 1) }} days
{{ number_format($usagePercentage, 1) }}%
@if($balance['remaining_days'] == 0) Exhausted @elseif($balance['remaining_days'] <= 2) Low @elseif($balance['used_days'] == 0) Unused @else Available @endif
No employee records found
@push('scripts') @endpush @endsection