@extends('template.layouts.template-base') @section('title') Attendance Report | {{ config('setting.website_name') ?: config('app.name') }} @endsection @section('content')

Attendance Report

@error('from_date')
{{ $message }}
@enderror
@error('to_date')
{{ $message }}
@enderror
@if(isset($staffList))
Dates: {{ date('d-m-Y',strtotime($fromDate)) .'/'. date('d-m-Y',strtotime($toDate)) }}
@if(isset($selected_client) && $selected_client->company_name)
Client: {{ $selected_client->company_name }}
@endif @if(isset($selected_project) && $selected_project->project_name)
Project: {{ $selected_project->project_name }}
@endif
@foreach($dates as $date) @endforeach @if($staffList->isEmpty()) @endif @foreach($staffList as $index => $staff) {{-- Live staff state from the Staff Releaving page: relieved staff show their relieving date and Inactive; staff made active again there show no date and Active --}} {{-- Department of the uploaded attendance sheet, or else the one from Staff Creation --}} @php // One shared calculation for the web report pages and the Excel export $row = \App\Services\AttendanceRules::reportRow($staff, $dates); @endphp @foreach($dates as $date) @php $cell = $row['cells'][$date]; $typeUpper = $cell['code']; @endphp {{-- A mark outside the DOJ – separation window stays visible but counts in no total --}} @endforeach {{-- Uploaded sheet's LOP hours, or else LOP days × 8 working hours a day --}} {{-- Present + paid leave + WO + NH, from the day cells of this row; blank days are never paid --}} {{-- Days with a meal chosen (1 per day); a month without daily meals: its uploaded Meal Days. Never the Present days --}} {{-- Days between max(DOJ, period start) and min(separation date, period end) --}} @endforeach
S.No Staff ID Name Separation Date Department Emp Status{{ date('d', strtotime($date)) }}Total Present Total Leave Total Weekoff Total Holiday Total Absent Total LOP Days Total LOP HRS Paid Days OT Hrs A shift B Shift C Shift Meal Days EL Days Total No of Payroll Days
No attendance records found for the selected client / project and period.
{{ $index + 1 }} {{ $staff->staff_id }} {{ $staff->staff_name }}{{ $staff->status == 0 && $staff->date_of_relieving ? date('d-m-Y', strtotime($staff->date_of_relieving)) : '-' }}{{ $staff->attendance->pluck('department')->filter()->first() ?: ($staff->department ?: '-') }} @if($staff->status == 1) Active @else Inactive @endif @if($typeUpper === 'P') {{ $typeUpper }} @elseif($typeUpper === 'A') {{ $typeUpper }} @elseif($typeUpper === 'WO') {{ $typeUpper }} @elseif($typeUpper === 'NH') {{ $typeUpper }} @elseif($typeUpper === 'LOP') {{ $typeUpper }} @elseif($typeUpper === 'L' || $typeUpper === 'CL') {{ $typeUpper }} @else - @endif {{ $row['total_present'] }} {{ $row['total_leave'] }} {{ $row['total_weekoff'] }} {{ $row['total_holiday'] }} {{ $row['total_absent'] }} {{ $row['total_lop_days'] }}{{ $row['total_lop_hrs'] }}{{ $row['paid_days'] }} {{ $row['ot_hrs'] }} {{ $row['a_shift'] }} {{ $row['b_shift'] }} {{ $row['c_shift'] }}{{ $row['meal_days'] }} {{ $row['el_days'] }}{{ $row['payroll_days'] }}
@endif @section('scripts') @endsection @endsection