@extends('layouts.backend') @section('title', 'Leave Balances') @section('content')

{{ $isSelfView ? __('My Leave Balance') : __('Leave Balances') }}

@include('partials.flash')
@if($canManageBalances && $hasAllAccess)
{{ __('Balance Sync (Salary Grade Policy to Employee)') }}
@csrf
@endif
{{ $isSelfView ? __('My Leave Balance History') : __('Employee Leave Balance List') }}
@if(! $isSelfView)
@endif
@if($canManageBalances) @endif @forelse($balances as $balance) @php($employee = $balance->employee) @php($employeeName = trim(($employee?->first_name ?? '').' '.($employee?->last_name ?? ''))) @if($canManageBalances) @endif @empty @endforelse
{{ __('Year') }} {{ __('Employee') }} {{ __('Salary Grade') }} {{ __('Category') }} {{ __('Opening') }} {{ __('Allocated') }} {{ __('Carry Fwd') }} {{ __('Earned') }} {{ __('Availed') }} {{ __('Adjustments') }} {{ __('Closing') }}{{ __('Action') }}
{{ $balance->year }} {{ $employeeName !== '' ? $employeeName : '-' }} ({{ $employee?->employee_code ?? '-' }}) {{ $employee?->salaryGrade?->grade_name ?? '-' }} {{ $balance->leaveCategory?->name ?? '-' }} {{ number_format((float) $balance->opening_balance, 2) }} {{ number_format((float) $balance->allocated, 2) }} {{ number_format((float) $balance->carried_forward, 2) }} {{ number_format((float) ($balance->earned_credited ?? 0), 2) }} {{ number_format((float) $balance->availed, 2) }} {{ number_format((float) $balance->adjustments, 2) }} {{ number_format((float) $balance->closing_balance, 2) }}
{{ __('No leave balance records found.') }}
{{ $balances->links('pagination::bootstrap-5') }}
@endsection