@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}} |
| Leave Type |
Days |
Enjoyed |
Balance |
@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
| {{ $type->name }} |
{{$type->leave_count }} |
{{$type_wise_taken_leave}} |
{{$type_wise_balance}} |
@endforeach
| Total |
{{$total_leave}} |
{{$total_leave_taken}} |
{{$total_leave_balance}} |
| SL |
Leave Type |
Start Date |
End Date |
Days |
Reason |
@php
$sl =1;
@endphp
@foreach($leaves as $leave)
| {{$sl++}} |
{{$leave->leaveTypeWithoutScope->name ?? null}} |
{{$leave->start_date}} |
{{$leave->end_date}} |
{{$leave->leave_count}} |
{{$leave->leave_reason}} |
@endforeach
| Total Leave: |
{{number_format($leaves->sum('leave_count'))}} |
|
@else
@if (request()->has('search') != null)
@endif
@endif