@extends('admin.layout.master') @section('content')

Monthly Duty Summary

@if(count($attendances) >0)
@include('payroll.includes.printAndExcel')
@endif
@if(count($attendances) >0) {{-- @dd($attendances) --}}
@php $i=1; @endphp @foreach (collect($attendances)->chunk(40) as $chunk_data)
@include('payroll.report_header',['store_address'=>true,'store_email'=>true,'contact_info'=>true,'text_align'=>"text-center"])
Monthly Duty Summary ({{ date("d-m-Y", strtotime($date_from)) }} - {{date("d-m-Y", strtotime($date_to))}})
@if(request('department_id')) {{ department(request('department_id'))->name }} @endif
Total Days : {{$total_days}} Fridays : {{$total_fridays}} Holidays : {{$total_holidays}} Working Days : {{$total_working_days}}
@foreach ($chunk_data as $data) {{-- @dd($data['attendances']->whereNotIn('status',['Weekend'])); --}} @php $late= $data['attendances']->whereNotNull('late')->count(); $counted_late = $data['late_policy'] ? ($late >= $data['late_policy'] ? (round($late/$data['late_policy'])) : 0) : 0; $early_leave= $data['attendances']->whereNotNull('early_leave')->count(); // dd($late, $early_leave,$data['late_policy'],$data['early_policy'] ); $counted_early =$data['early_policy'] ? ( $early_leave >= $data['early_policy'] ? (round($early_leave/$data['early_policy'])) : 0) : 0; @endphp @endforeach
#SL Code Name Designation Total Attendance Absents Leaves OT Lates Counted Late Early Counted Early Double
{{$i++}} {{$data['employee_info']->emp_code}} {{$data['employee_info']->emp_name}} {{$data['employee_info']->fetch_designation ? $data['employee_info']->fetch_designation->name : null}} {{$data['attendances']->whereNotIn('status',['Weekend','Holiday','Absent'])->count()}} {{$data['attendances']->where('status','Absent')->count()}} {{$data['attendances']->where('status','Leave')->count()}} {{$data['attendances']->sum('over_time_hours')}} {{$late}} {{$counted_late}} {{$early_leave}} {{$counted_early}} {{$data['attendances']->whereNotNull('double')->count()}}
@endforeach
@else @if(request()->get('search') !=null)

No Data Found

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