@extends('admin.layout.master') @section('title','Leave Details') @section('custom_style') @endsection @section ('content')

Employee Leave Details

@include('payroll.includes.report_print_excel_button')
@php $employee= get_employee_by_id(request()->employee_id); @endphp
@if(count($leaves)>0)
{!! $print['head'] !!} @include('payroll.report_header', ['title' => "Leave Details",'text_align'=>"text-center"])
Code {{$employee->emp_code}}
Name {{$employee->emp_name}}
Designation {{$employee->fetch_designation ? $employee->fetch_designation->name : null}}
Department {{$employee->fetch_designation ? $employee->fetch_department->name : null}}
@php $total_leave = $leave_types->sum('leave_count'); $total_leave_taken = 0; $total_leave_balance= 0; @endphp @foreach ($leave_types as $type) @php $all_appvoved_leaves = current_year_approved_employee_leaves($employee); $type_wise_taken_leave = $all_appvoved_leaves->where('leave_type_id',$type->id)->sum('leave_count'); $type_wise_balance = $type->leave_count - $type_wise_taken_leave; $total_leave_taken +=$type_wise_taken_leave; $total_leave_balance +=$type_wise_balance; @endphp @endforeach
Leave Type Days Enjoyed Balance
{{ $type->name }} {{$type->leave_count }} {{$type_wise_taken_leave}} {{$type_wise_balance}}
Total {{$total_leave}} {{$total_leave_taken}} {{$total_leave_balance}}
@php $sl =1; @endphp @foreach($leaves as $leave) @endforeach
SL Leave Type Start Date End Date Days Reason
{{$sl++}} {{$leave->leaveTypeWithoutScope->name ?? null}} {{$leave->start_date}} {{$leave->end_date}} {{$leave->leave_count}} {{$leave->leave_reason}}
Total Leave: {{number_format($leaves->sum('leave_count'))}}
@else @if (request()->has('search') != null)

No Data Found

@endif @endif
@endsection @section('script') @endsection