@extends('layouts.app') @section('title','Leave Management') @section('content') @if($page==='overview')
@foreach($stats as $label=>$count)
{{ $label }}{{ $count }}
@endforeach
@elseif($page==='request')Back to requests

{{ $leave->employee->full_name }} · {{ $leave->type->name }} {{ str_replace('_',' ',$leave->status) }}

{{ $leave->starts_on->toDateString() }}–{{ $leave->ends_on->toDateString() }} · {{ \App\Domain\Payroll\Money::format($leave->units) }} working days · {{ $leave->reason }}

@if((auth()->user()->hasPermission('leave.approve') && $leave->status==='pending_hr') || (auth()->user()->hasPermission('manager.approve') && $leave->status==='pending_manager' && $leave->manager_id===\App\Models\Employee::where('user_id',auth()->id())->value('id')))@include('operations.decision',['action'=>$base.'/leave/'.$leave->id.'/decide'])@endif @can('leave.manage')@if(in_array($leave->status,['pending_manager','pending_hr','approved']))
@csrf
@endif @endcan

Decision history

@forelse($decisions as $decision)

{{ $decision->created_at }} · {{ $decision->stage }} · {{ $decision->decision }} · {{ $decision->note }}

@empty

No decisions recorded.

@endforelse
@elseif($page==='type')Back to types

{{ $type->name }}

{{ $type->paid?'Paid':'Unpaid' }} · Annual {{ $type->annual_units/100 }} days · Carry cap {{ $type->carry_cap_units/100 }} days · {{ $type->encashable?'Encashable':'Not encashable' }}

@elseif(in_array($page,['requests','approvals','calendar'])) @if($page==='approvals')
Pending approvalsApproval history
@endif @if($page==='calendar')

Requests overlapping the selected month, including their approval status.

@endif @if($page==='calendar')
@foreach(\Carbon\CarbonPeriod::create($month.'-01',\Carbon\CarbonImmutable::parse($month.'-01')->endOfMonth()) as $day)
{{ $day->format('D j') }}@foreach($calendarEntries->filter(fn($entry)=>$entry->starts_on->lte($day) && $entry->ends_on->gte($day)) as $entry){{ $entry->employee?->full_name }} · {{ $entry->status }}@endforeach
@endforeach
@endif
@forelse($requests as $leave)@empty@endforelse
EmployeeLeave typeDatesDaysStatusActions
{{ $leave->employee?->full_name }}{{ $leave->type?->name }}{{ $leave->starts_on->toDateString() }} – {{ $leave->ends_on->toDateString() }}{{ $leave->units/100 }}{{ str_replace('_',' ',$leave->status) }}View{{ $page==='approvals'?' / Review':'' }}
No matching leave requests.
@elseif($page==='balances')
@foreach(['branch','department'] as $kind)@endforeach

Current balances

@php($uiRows1=$employees)
@foreach($types as $type)@endforeach@foreach($uiRows1 as $e)@foreach($types as $type)@endforeach@endforeach
Employee{{ $type->name }}
{{ $e->employee_number }} · {{ $e->full_name }}{{ !$type->paid && !$type->annual_units?'Uncapped':\App\Domain\Payroll\Money::format(app(\App\Domain\Operations\LeaveService::class)->balance($e->id,$type->id,\App\Domain\Operations\Operations::today())) }}
@elseif($page==='ledger')

Balance ledger

@php($uiRows2=\App\Support\ListView::rows($ledger,'leave_ledger_entries'))
@foreach($uiRows2 as $l)@endforeach
EmployeeTypeEffectiveDaysSource
{{ $l->employee->employee_number }}{{ $l->type->name }}{{ $l->effective_on->toDateString() }}{{ \App\Domain\Payroll\Money::format($l->units) }}{{ $l->source_key }}
@elseif($page==='types')Create Leave Type
@forelse($types as $type)@empty@endforelse
TypePaidAnnual daysCarry capActions
{{ $type->name }}{{ $type->paid?'Yes':'No' }}{{ $type->annual_units/100 }}{{ $type->carry_cap_units/100 }}View
No leave types.
@elseif($page==='reports')

Leave registers

Open a register to filter and preview existing records.

@elseif($page==='settings')

Existing leave rules

Entitlement, accrual, carry-forward caps and encashment are configured on leave types. Requests use existing manager and HR approval rules.

Manage leave types
@endif @endsection