@php $tagList = $_data->leaveService->fetchLeaveTypeTag(); $tagListForOb = $_data->leaveService->fetchLeaveTypeTagForOpenningBalance(); $targetMonth = $monthListWithoutFormat[$selectedMonth]; @endphp @foreach ($tagListForOb as $tag) @endforeach @foreach ($tagList as $tag) @endforeach @foreach ($tagList as $tag) @endforeach @foreach ($tagList as $tag) @if($tag->slug == 'annual' || $tag->slug == 'npl' || $tag->slug == 'casual') @else @endif @endforeach @foreach ($tagList as $tag) @if($tag->slug == 'annual' || $tag->slug == 'npl' || $tag->slug == 'casual') @else @endif @endforeach @foreach ($tagList as $tag) @endforeach @foreach($_data->users as $user) @php $colContainer = []; $leaveTypes = $_data->leaveService->fetchEmployeeLeaveTypesByFiscalYear($user->employee, $_data->selectedFiscalYear); $employee = $user->employee; foreach ($tagList as $tag) { $maxLeave = 0; $openingLeave = 0; $eligibleLeaveUptoCurrentMonth = 0; $consumedOnCurrentMonthReg = 0; $consumedOnCurrentMonthLate = 0; $consumedOnFiscalYearReg = 0; $consumedOnFiscalYearLate = 0; $remainingBalanceForFiscalyear = 0; $volatileRecord = [ 'class' => 'Reg', 'amount' => 0, ]; $leaveType = $tag->leaveTypeOfTheEmployee( $employee ); $leaveStatus = $_data->leaveService->getLeaveStatusInfoByUserIdFiscalYearAndLeaveType( $user->id, $_data->selectedFiscalYear, $leaveType, $targetMonth ); if($tag->slug == 'earn' || $tag->slug == 'maternity' || $tag->slug == 'paternity'){ $openningVolatileRecord = []; $openningVolatileRecord['tag'] = $tag; $openningVolatileRecord['amount'] = $leaveStatus['openningLeave'] ?? 0; $colContainer['openningLeaveBalance'][] = $openningVolatileRecord; } $maxLeave = $_data->leaveService->getEmployeeMaxLeaveOfTheLeaveTypeInTheFiscalYear( $employee, $leaveType, $_data->selectedFiscalYear ); $colContainer['maxLeave'][] = $leaveStatus['maximumLeave'] ?? 0; $eligibleLeaveUptoCurrentMonth = $_data->leaveService->getEmployeeEligibleLeaveInDateRange( $employee, $leaveType, $_data->selectedFiscalYear->fyStartDate, date('Y-m-t', strtotime($targetMonth)) ); $colContainer['eligibleLeaveUptoCurrentMonth'][] = $eligibleLeaveUptoCurrentMonth ?? 0; $colContainer['type'][] = $leaveType; $colContainer['tag'][] = $tag; if($tag->slug == 'annual' || $tag->slug == 'npl' || $tag->slug == 'casual') { $consumedOnFiscalYearReg = $_data->leaveService->getEmployeeConsumedLeaveByLeaveTypeAndDateRange( $employee, $leaveType, $_data->selectedFiscalYear->fyStartDate, date('Y-m-t', strtotime($targetMonth)) ); $volatileRecord['class'] = 'Reg'; $volatileRecord['amount'] = $consumedOnFiscalYearReg; $colContainer['consumedOnFiscalYear'][] = $volatileRecord; $consumedOnFiscalYearLate = $_data->leaveService->getEmployeeConsumedLateLeaveByLeaveTypeAndDateRange( $employee, $leaveType, $_data->selectedFiscalYear->fyStartDate, date('Y-m-t', strtotime($targetMonth)) ); $volatileRecord['class'] = 'Late'; $volatileRecord['amount'] = $consumedOnFiscalYearLate; $colContainer['consumedOnFiscalYear'][] = $volatileRecord; $consumedOnCurrentMonthReg = $_data->leaveService->getEmployeeConsumedLeaveByLeaveTypeAndDateRange( $employee, $leaveType, date('Y-m-01', strtotime($targetMonth)), date('Y-m-t', strtotime($targetMonth)) ); $volatileRecord['class'] = 'Reg'; $volatileRecord['amount'] = $consumedOnCurrentMonthReg; $colContainer['consumedOnCurrentMonth'][] = $volatileRecord; $consumedOnCurrentMonthLate = $_data->leaveService->getEmployeeConsumedLateLeaveByLeaveTypeAndMonth( $employee, $leaveType, date('Y-m-d', strtotime($targetMonth)) ); $volatileRecord['class'] = 'Late'; $volatileRecord['amount'] = $consumedOnCurrentMonthLate; $colContainer['consumedOnCurrentMonth'][] = $volatileRecord; } else { $consumedOnFiscalYearReg = $_data->leaveService->getEmployeeConsumedLeaveByLeaveTypeAndDateRange( $employee, $leaveType, $_data->selectedFiscalYear->fyStartDate, date('Y-m-t', strtotime($targetMonth)) ); $volatileRecord['class'] = 'Reg'; $volatileRecord['amount'] = $consumedOnFiscalYearReg; $colContainer['consumedOnFiscalYear'][] = $volatileRecord; $consumedOnCurrentMonthReg = $_data->leaveService->getEmployeeConsumedLeaveByLeaveTypeAndDateRange( $employee, $tag->leaveTypeOfTheEmployee( $employee ), date('Y-m-01', strtotime($targetMonth)), date('Y-m-t', strtotime($targetMonth)) ); $volatileRecord['class'] = 'Reg'; $volatileRecord['amount'] = $consumedOnCurrentMonthReg; $colContainer['consumedOnCurrentMonth'][] = $volatileRecord; } $colContainer['remaingLeaveOnFiscalyear'][] = $leaveStatus['remainingLeave'] ?? 0; } @endphp {{-- Openning Balance Up to Jun-2018 --}} @foreach ($colContainer['openningLeaveBalance'] as $item) @endforeach {{-- Leave Allocation for Fiscal Year --}} @foreach ($colContainer['maxLeave'] as $item) @endforeach {{-- Eligible Leave up to Current Month --}} @foreach ($colContainer['eligibleLeaveUptoCurrentMonth'] as $item) @endforeach {{-- Consumed On Current Month --}} @foreach ($colContainer['consumedOnCurrentMonth'] as $item) @endforeach {{-- Consumed On Current this Fiscal Year --}} @foreach ($colContainer['consumedOnFiscalYear'] as $item) @endforeach {{-- Consumed On Current this Fiscal Year --}} @foreach ($colContainer['remaingLeaveOnFiscalyear'] as $item) @endforeach @endforeach
SL Employee Name ID Designation Openning Balance Up to {{ date( 'M-Y', strtotime($_data->selectedFiscalYear->getPrevious()->fyEndDate)) }} Leave Allocation for Report Type {{ $_data->selectedFiscalYear->name }} Eligible Leave up to {{ date('M-Y', strtotime($targetMonth)) }} Consumed On {{ date('M-Y', strtotime($targetMonth)) }} Consumed On Fiscal Year {{ $_data->selectedFiscalYear->name }} Reamining For Fiscal Year
{{ $tag->short_name }}{{ $tag->short_name }}{{ $tag->short_name }}{{ $tag->short_name }}{{ $tag->short_name }}{{ $tag->short_name }}{{ $tag->short_name }}{{ $tag->short_name }}
Reg Late Reg Late Reg Late Reg Late Reg Late Reg Late
{{ $loop->iteration }} {{ $employee->emp_name_english ?? '' }} {{ $employee->emp_id ?? ''}} {{ $employee->organization->position->name ?? '' }} {{ $item['amount'] > 0 ? $item['amount'] : '-'}} {{ $item > 0 ? $item : '-'}} {{ $item > 0 ? $item : '-'}} {{ $item['amount'] > 0 ? $item['amount'] : '-'}} {{ $item['amount'] > 0 ? $item['amount'] : '-'}} {{ $item > 0 ? $item : '-'}}
Prepared By
Checked By
Reviewed By
Approved By