@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Leave Report')) @section('content')
{{ __('Leave Report') }}
{{ __('Matrix reports: pick year; month is optional (yearly vs monthly).') }}
@if(($report_type ?? 'staff') === 'staff' && $staff_id && $staff_info && $leaves !== null)
@if(get_setting('system_logo_white') != null) {{ get_setting('site_name') }} @endif
{{ get_setting('site_name') }}
{{ !empty($staff_info->warehouse) ? $staff_info->warehouse->address : '' }}
{{ __('Employee Code') }} {{ !empty($staff_info->user) ? $staff_info->user->id : '' }} {{ __('Designation') }} {{ !empty($staff_info->designation) ? $staff_info->designation->name : '-' }}
{{ __('Employee Name') }} {{ !empty($staff_info->user) ? $staff_info->user->name : '-' }} {{ __('Warehouse/Branch') }} {{ !empty($staff_info->warehouse) ? $staff_info->warehouse->name : '-' }}
{{ __('Leave Report') }} @if(request()->month) {{ date('F', mktime(0, 0, 0, (int)request()->month, 1)) }} — @endif {{ $year ? $year : __('All periods') }}
@forelse($leaves as $key => $leave) @empty @endforelse
# {{ __('Staff Name') }} {{ __('Apply Date') }} {{ __('Paid Leave') }} {{ __('From') }} {{ __('To') }} {{ __('Duration') }} {{ __('Remarks') }} {{ __('Approval') }}
{{ $key + 1 }} {{ !empty($staff_info->user) ? $staff_info->user->name : '-' }} {{ $leave->apply_date }} @if($leave->type == 'paid') @else @endif {{ $leave->start }} {{ $leave->end }} {{ $leave->number_of_days }} {{ __('Days') }} {{ $leave->reason }} @if($leave->status == 1) @else @endif
{{ __('No record found') }}
{{ __('Leave Summary') }}
@foreach(\App\Models\LeaveType::where('group_id', $staff_info->leave_group_id)->get() as $leave_type) @php $taken = $leaves->where('leave_type_id', $leave_type->id)->sum('number_of_days'); $adjustment_balance = $adjustment->where('leave_type_id', $leave_type->id)->sum('balance'); $sy = (int)($summary_year ?? date('Y')); @endphp @endforeach
{{ $leave_type->name }} {{ __('Allowed') }}: @if (date('Y', strtotime($staff_info->joing_date)) == $sy) {{ $leave_have = app_round(($leave_type->day / 12) * (12 - date('m', strtotime($staff_info->joing_date)) + 1), 0) }} @else {{ $leave_have = $leave_type->day }} @endif {{ __('Taken') }}: {{ $taken }} {{ __('Adjustment') }}: {{ $adjustment_balance }} {{ __('Remaining') }}: {{ ($leave_have + $adjustment_balance) - $taken }}
@endif @if(!empty($showMatrixReport) && $staff_infos && $staff_infos->isNotEmpty() && $leaves !== null && !empty($leaveStatusMatrix))
@if(get_setting('system_logo_white') != null) {{ get_setting('site_name') }} @endif
{{ $matrixTitle ?? '' }}@if(!empty($matrixSubTitle)) — {{ $matrixSubTitle }}@endif
{{ __('Employee Leave Status') }}
@if(!empty($leaveReportPeriod))
{{ $leaveReportPeriod }}
@endif
@foreach($leaveStatusMatrix['leaveTypes'] as $leaveType) @endforeach @foreach($leaveStatusMatrix['leaveTypes'] as $leaveType) @endforeach @forelse($leaveStatusMatrix['rows'] as $row) @foreach($leaveStatusMatrix['leaveTypes'] as $leaveType) @php $cell = $row['cells'][$leaveType->key] ?? ['allocated' => null, 'used' => null, 'balance' => null]; @endphp @if($cell['allocated'] === null) @else @endif @endforeach @empty @endforelse
# {{ __('Employee') }}{{ $leaveType->name }}
{{ __('Allocated') }} {{ __('Used') }} {{ __('Balance') }}
{{ $row['num'] }} {{ $row['name'] }} ( {{ $row['code'] }} )- - -{{ $cell['allocated'] }} {{ $cell['used'] }} {{ $cell['balance'] }}
{{ __('No record found') }}
@endif @endsection @section('script') @endsection