@php $editLeavePermission = user()->permission('edit_leave'); $deleteLeavePermission = user()->permission('delete_leave'); $approveRejectPermission = user()->permission('approve_or_reject_leaves'); @endphp

{{$leaves_used + $remaining_leaves }}

{{$leaves_used}}

{{$remaining_leaves}}

@lang('app.leavesDetails')

@lang('app.applyDate') - {{ $leave->created_at->timezone(company()->timezone)->translatedFormat(company()->date_format .' ' . company()->time_format) }}
@php $leaveType = '' . $leave->type->type_name . ''; if ($leave->status == 'approved') { $class = 'text-light-green'; $status = __('app.approved'); } elseif ($leave->status == 'pending') { $class = 'text-yellow'; $status = __('app.pending'); } elseif ($leave->status == 'nfd') { $class = 'text-yellow'; $status = __('Needs Further Documentation'); } else { $class = 'text-red'; $status = __('app.rejected'); } $paidStatus = ' ' . $status; $reject_reason = !is_null($leave->reject_reason) ? $leave->reject_reason : '--'; $approve_reason = !is_null($leave->approve_reason) ? $leave->approve_reason : '--'; @endphp

@lang('modules.leaves.applicantName')

@if ($leave->duration == 'half day')

@lang('app.duration')

@lang('modules.leaves.halfDay') @if (!is_null($leave->half_day_type)) {{ ($leave->half_day_type == 'first_half') ? __('modules.leaves.firstHalf') : __('modules.leaves.secondHalf') }} @endif

@endif @if (!is_null($leave->manager_status_permission)) @endif @if (!is_null($leave->approved_by))

@lang('modules.leaves.approvedBy')

@endif @if (!is_null($leave->approved_at)) @endif @if ($leave->status == 'rejected') @endif @if ($leave->status == 'nfd') @endif @if ($leave->status == 'approved') @endif

@lang('app.file')

@forelse($leave->files as $file) @if ($file->icon == 'images') @else @endif @empty @endforelse

@if ($leave->status == 'pending' || $leave->status == 'nfd')
@if ($reportingTo && $leave->user_id != user()->id && !in_array('admin', user_roles())) @if($leave->manager_status_permission == '' && !($reportingPermission == 'cannot-approve')) @lang('app.reject') @endif @if ($reportingPermission == 'approved' && $leave->manager_status_permission == '') @lang('app.approve') @elseif($reportingPermission == 'pre-approve' && !$leave->manager_status_permission) @lang('app.preApprove') @endif @endif @if ($leave->status == 'pending' && $approveRejectPermission == 'all') @lang('app.approve') @lang('app.reject') @endif @if ($leave->status == 'nfd' && $approveRejectPermission == 'all') @lang('app.approve') @lang('Needs Further Document') @lang('app.reject') @endif @if ($editLeavePermission == 'all' || ($editLeavePermission == 'added' && user()->id == $leave->added_by) || ($editLeavePermission == 'owned' && user()->id == $leave->user_id) || ($editLeavePermission == 'both' && (user()->id == $leave->user_id || user()->id == $leave->added_by))) @endif @if (($deleteLeavePermission == 'all' || ($deleteLeavePermission == 'added' && user()->id == $leave->added_by) || ($deleteLeavePermission == 'owned' && user()->id == $leave->user_id) || ($deleteLeavePermission == 'both' && (user()->id == $leave->user_id || user()->id == $leave->added_by)))) @lang('app.delete') @endif
@endif