@extends('app-new') @push('head-script') @endpush @push('content-header') @endpush @section('content') @if ($time) {{ Form::open(['url' => $alias . '/attendance-report/day-summary?time=1', 'method' => 'GET']) }} @else
@endif
{{ trans('common/common.filter') }}
{!! $errors->first('date_range', '') !!} @if (Auth::user()->is_contractor == 0) @endif @if (Auth::user()->is_contractor == 0) @else @endif
  • {{ ucfirst(App\Helpers\ConstantHelper::MODIFIED) }}
  • {{ ucfirst(App\Helpers\ConstantHelper::REGULARIZED) }}
  • Present
  • Absent
  • Half-day
  • Week-off
  • Holiday
  • Leave
{{-- @if ($time) @endif --}} @if ($time)
@endif
@if (!$time) @endif @foreach ($dateArr as $dates) @endforeach @if (!$time) @php $maxLeaveCount = 0; foreach ($employeeSummary as $value) { $count = count($value->Leave_types ?? []); if ($count > $maxLeaveCount) { $maxLeaveCount = $count; } } @endphp @endif @foreach ($employeeSummary as $key => $value) @php $totalPaidDays = $totalPresent = $overtime = $actualOvertime = $totalActualOvertime = $totalovertime = 0; $attendanceSummaryProcess = new App\Lib\Services\AttendanceSummaryProcess(); $woHoCounts = $attendanceSummaryProcess->getAttSmryWOHOCount( $organization->id, $value->id, $fromDate, $toDate ); @endphp @if (!$time) @endif @foreach ($dateArr as $date) @php $attendance = $value->attendanceSummary->where('attendance_date', $date)->first(); @endphp @if (!$attendance) @continue; @endif @php $overtime +=intval(substr($attendance->overtime, 0, -6)) * 60 + intval(substr($attendance->overtime, -5, -3)); $totalovertime = round($overtime / 60, 2); $actualOvertime += intval(substr($attendance->actual_overtime, 0, -6)) * 60 + intval(substr($attendance->actual_overtime, -5, -3)); $totalActualOvertime = round($actualOvertime / 60, 2); $autoWeekClass = $attendance->remarks == App\Helpers\ConstantHelper::AUTO_WEEK_OFF ? 'autoweekoff' : ''; $attendanceColors = [ 'present' => 'bg-light-success', 'absent' => 'bg-light-danger', 'week-off' => 'bg-light-yellow', 'holiday' => 'bg-light-grey', 'leave' => 'bg-light-blue', ]; $boxColor = $attendanceColors[$attendance->attendance_type] ?? ''; if (round($attendance->day_count, 2) == 0.50 && $attendance->attendance_type=='present') { $boxColor = 'bg-light-orange'; } $entryModeColors = [ App\Helpers\ConstantHelper::REGULARIZED => 'bg-light-green', App\Helpers\ConstantHelper::MODIFIED => 'bg-light-sky', ]; $boxColor = $entryModeColors[$attendance->entry_mode] ?? $boxColor; $totalPaidDays += $attendance->day_count ?: 0; if ( $attendance->attendance_type == 'present' && $attendance->on_duty == 1 ) { $totalPresent = $totalPresent + $attendance->day_count; } @endphp @endforeach @if (!$time) @php $totalPayableSeconds = 0; foreach ($value->attendanceSummary as $attendance) { $timeParts = explode(':', $attendance->payable_hours); if (count($timeParts) === 3) { $hours = (int) $timeParts[0]; $minutes = (int) $timeParts[1]; $seconds = (int) $timeParts[2]; $totalPayableSeconds += ($hours * 3600) + ($minutes * 60) + $seconds; } } $decimalPayableHours = $totalPayableSeconds / 3600; @endphp @php $totalProductiveSeconds = 0; foreach ($value->attendanceSummary as $attendance) { $timeParts = explode(':', $attendance->productive_hours); if (count($timeParts) === 3) { $hours = (int) $timeParts[0]; $minutes = (int) $timeParts[1]; $seconds = (int) $timeParts[2]; $totalProductiveSeconds += ($hours * 3600) + ($minutes * 60) + $seconds; } } $decimalProductiveHours = $totalProductiveSeconds / 3600; @endphp @foreach ($value->Leave_types as $leave) @endforeach @endif @endforeach
{{ $employeeSummary->appends($nextQuery)->links('pagination::bootstrap-4') }}
@endsection @push('footer-script') {{-- date range picker --}} @endpush