@foreach($_data->fiscalYearMonthList as $month) @endforeach @php $optionalParam['leave_application_module'] = true; @endphp @foreach($_data->leaveTypes as $leaveType) @php $regRow = []; $lateRow = []; $leaveStatus = $_data->leaveService->getLeaveStatusInfoByUserIdFiscalYearAndLeaveType( $_data->user->id, $_data->selectedFiscalYear, $leaveType, null, $optionalParam ); $ob = $leaveStatus['openningLeave']; $yearlyAllocation = $leaveStatus['maximumLeave']; $totalConsumedLeave = $leaveStatus['consumedLeave']; $remainingLeave = $leaveStatus['remainingLeave']; @endphp @if($leaveType->tag->slug == 'annual' || $leaveType->tag->slug == 'npl' || ($_data->user->employee->organization->recruitmentType->job_type == 'Non-Permanent' && $leaveType->tag->slug == 'casual')) @foreach($_data->fiscalYearMonthList as $month) @php $monnthStartDate = date('Y-m-01', strtotime($month)); $monnthLastDate = date('Y-m-t', strtotime($month)); $thisMonthConsumedRegLeave = $_data->leaveService->getEmployeeConsumedLeaveByLeaveTypeAndMonthRangeV2($_data->user->employee, $leaveType, $monnthStartDate, $monnthLastDate, null, $optionalParam); $thisMonthConsumedLateLeave = $_data->leaveService->getEmployeeConsumedLateLeaveByLeaveTypeAndMonth($_data->user->employee, $leaveType, $month, $optionalParam); $regRow[] = $thisMonthConsumedRegLeave; $lateRow[] = $thisMonthConsumedLateLeave; @endphp @endforeach @foreach($regRow as $item) @endforeach @foreach($lateRow as $item) @endforeach @else @foreach($_data->fiscalYearMonthList as $month) @php $monnthStartDate = date('Y-m-01', strtotime($month)); $monnthLastDate = date('Y-m-t', strtotime($month)); // $thisMonthConsumedLeave = $_data->leaveService->getEmployeeConsumedLeaveByLeaveTypeAndMonthRange( $thisMonthConsumedLeave = $_data->leaveService->getEmployeeConsumedLeaveByLeaveTypeAndMonthRangeV2( $_data->user->employee, $leaveType, $monnthStartDate, $monnthLastDate, null, $optionalParam); @endphp @endforeach @endif @endforeach
Leave Type Openning Balance Yearly Allocation Eligible Consume on Fiscal year Total Consumed Remaining Balance
{{ date('M-y', strtotime($month)) }}
{{ $leaveType->short_name }} Regular {{ $ob != 0 ? $ob : '-' }} {{ $yearlyAllocation != 0 ? $yearlyAllocation : '-' }} @php $getEmployeeEligibleLeave = $_data->leaveService->getEmployeeEligibleLeave( $_data->user->employee, $yearlyAllocation, $_data->selectedFiscalYear, $leaveType, $optionalParam ); @endphp {{ $getEmployeeEligibleLeave != 0 ? $getEmployeeEligibleLeave : '-' }} {{ $item != 0 ? $item : '-' }} {{ $totalConsumedLeave != 0 ? $totalConsumedLeave : '-' }} {{ $remainingLeave != 0 ? $remainingLeave : '-' }}
Late.{{ $item != 0 ? $item : '-' }}
{{ $leaveType->short_name }} {{ $ob != 0 ? $ob : '-' }} {{ $yearlyAllocation != 0 ? $yearlyAllocation : '-' }} @php $eligibleLeave = $_data->leaveService ->getEmployeeEligibleLeave($_data->user->employee, $yearlyAllocation, $_data->selectedFiscalYear, $leaveType, $optionalParam) @endphp @if($eligibleLeave > 0) {{-- * If it is earn leave and eligible leave is greater than 0, it means employee has been completed 5 years * and he will elegible total earn leave, and yearly allocated earn leave will be added next year --}} @if($leaveType->tag->slug == 'earn') {{ $ob }}{{-- Eligible total earn leave --}} @else {{ $eligibleLeave }} @endif @else - @endif {{ $thisMonthConsumedLeave != 0 ? $thisMonthConsumedLeave : '-' }} {{ $totalConsumedLeave != 0 ? $totalConsumedLeave : '-' }} {{ $remainingLeave != 0 ? $remainingLeave : '-' }}