@php use App\Models\User; @endphp {{ auth()->user()->tenant_name }} - Vendor Working Hour Report
{{-- --}}
@foreach ($dateRanges as $index => $dateRange) @php $Date = \Carbon\Carbon::parse($dateRange)->format('Y-m-d'); // Counting the number of users with punches within the date range $presentCount = User::whereNot('id', $authUser->id) ->where('contractor_id', $contractor_id) ->where('is_employee', 1) ->with(['empShifts' => function($q) use ($fromDate, $toDate) { $q->whereBetween('from_date', [$fromDate, $toDate]); }]) ->whereHas('punches', function($q) use ($Date) { $q->where('punch_date', $Date); }) ->count(); @endphp @endforeach
Sr No Date Total Employee Present Count Employee Completed Hours Differance
{{ $index + 1 }} {{ $Date }} {{ ($total_emp) ? $total_emp->total_emp : 0 }} {{ ($presentCount) ? $presentCount : 0 }} {{ ($presentCount) ? $presentCount * 8 : 0 }} {{ ($total_emp) ? ($total_emp->total_emp * 8) - ($presentCount * 8) : 0 }}
{{-- Get month wise date --}}