@if ($hasLeaveQuotas)
@lang('modules.leaves.leaveType') @lang('modules.leaves.noOfLeaves') @lang('modules.leaves.monthLimit') @lang('app.totalLeavesTaken') @lang('modules.leaves.remainingLeaves') @lang('modules.leaves.overUtilized') @php $processedLeaveTypes = []; @endphp @foreach ($employeeLeavesQuotas as $key => $leavesQuota) @php if (in_array($leavesQuota->leave_type_id, $processedLeaveTypes)) { continue; // Skip this iteration if already processed } // Add the current leave_type_id to the array $processedLeaveTypes[] = $leavesQuota->leave_type_id; $remleaves = ($leaveCounts[$leavesQuota->leave_type_id] > ($leavesQuota?->no_of_leaves ?: 0)) ? 0 : ($leavesQuota?->no_of_leaves ?: 0) - ($leaveCounts[$leavesQuota->leave_type_id] ?: 0) ; $noofleaves = ($leaveCounts[$leavesQuota->leave_type_id] > ($leavesQuota?->no_of_leaves ?: 0)) ? $leaveCounts[$leavesQuota->leave_type_id] : ($leavesQuota?->no_of_leaves ?: 0); @endphp @if($leavesQuota->leaveType && $leavesQuota->leaveType->leaveTypeCondition($leavesQuota->leaveType, $employee) && ($leavesQuota->leaveType->deleted_at == null || $leavesQuota->leaves_used > 0) ) leaveType->deleted_at != null) style="background-color: #c8d3dd !important;" @endif> @if($leavesQuota->leaveType->deleted_at != null) ( @lang('app.leaveArchive') ) @endif {{ $leavesQuota?->no_of_leaves ?: 0 }} {{-- {{ $noofleaves }} --}} {{ ($leavesQuota->leaveType->monthly_limit > 0) ? $leavesQuota->leaveType->monthly_limit : '--' }} {{ $leaveCounts[$leavesQuota->leave_type_id] }}{{-- {{ $leavesQuota->leaves_used }} --}} {{ $remleaves }} {{ ($leaveCounts[$leavesQuota->leave_type_id] - $leavesQuota?->no_of_leaves) > 0 ? ($leaveCounts[$leavesQuota->leave_type_id] - $leavesQuota?->no_of_leaves) : 0 }} @endif @endforeach
@endif @if (!$hasLeaveQuotas) @endif