@extends('layouts.horizontal', ['title' => 'Attendance Report', 'topbarTitle' => 'Attendance Report']) @section('css') @vite(['node_modules/datatables.net-bs5/css/dataTables.bootstrap5.min.css', 'node_modules/datatables.net-responsive-bs5/css/responsive.bootstrap5.min.css', 'node_modules/datatables.net-fixedcolumns-bs5/css/fixedColumns.bootstrap5.min.css', 'node_modules/datatables.net-fixedheader-bs5/css/fixedHeader.bootstrap5.min.css', 'node_modules/datatables.net-buttons-bs5/css/buttons.bootstrap5.min.css', 'node_modules/datatables.net-select-bs5/css/select.bootstrap5.min.css', 'node_modules/dropzone/dist/dropzone.css', 'node_modules/select2/dist/css/select2.min.css', 'node_modules/flatpickr/dist/flatpickr.min.css']) @endsection @section('content')

@if($viewType === 'detail') Attendance Details: {{ $staff->staff_fullname }} - {{ $monthName }}-{{ $year }} @else Staff Attendance Report @endif

@if($viewType === 'detail') Back to Report @endif
@if($viewType === 'detail')
Staff Name:
{{ $staff->staff_fullname }}
Staff ID:
{{ $staff->id_staff }}
Business:
{{ $staff->business->business_name ?? 'N/A' }}
Salary Type:
{{ ucfirst($staff->salary_type) }}
Week Off:
{{ $staff->week_day_off ?? 'N/A' }}
Present:

{{ $presents }}

Absent:

{{ $absents }}

Late:

{{ $late }}

Leave:

{{ $leave }}

Holiday:

{{ $holiday }}

Work Hours:

{{ number_format($workhours_total, 2) }}

Overtime Hours:

{{ number_format($overtime_hours_total, 2) }}

@foreach($payables as $payable) @php $date = \Carbon\Carbon::parse($payable['Date']); $formattedDate = $date->format('d-M-Y'); $offday = ''; $dayClass = ''; if ($payable['is_weekend']) { $dayClass = 'text-danger'; $offday = '(Day Off)'; } elseif ($payable['Holiday'] != 0) { $dayClass = 'text-primary'; } elseif ($payable['is_overtime_day']) { $dayClass = 'text-warning'; } $dayText = $payable['Day']; if ($payable['leave_reason']) { $dayText .= ' ' . $payable['leave_reason']; } if ($payable['holiday_reason']) { $dayText .= ' ' . $payable['holiday_reason']; } $dayText .= ' ' . $offday; @endphp @endforeach
Date Day Time In Time Out Work Hours Overtime Hours Present Absent Late Leave Holiday Marked From Remarks
{{ $formattedDate }} {{ $dayText }} @if($payable['is_overtime_day'])
(Overtime Day) @endif
{{ $payable['time_in'] }} {{ $payable['time_out'] }} {{ number_format($payable['Work_Hours'], 2) }} {{ number_format($payable['overtime_hours'] ?? 0, 2) }} @if($payable['Present'] == 1) @else @endif @if($payable['Absent'] == 1) @else @endif @if($payable['Late'] == 1) @else @endif @if($payable['Leaves'] == 1) @else @endif @if($payable['Holiday'] == 1) @else @endif {{ $payable['address'] ?? '' }} @if($payable['leave_reason']) Leave: {{ $payable['leave_reason'] }} @endif @if($payable['holiday_reason']) Holiday: {{ $payable['holiday_reason'] }} @endif
Totals: {{ number_format($workhours_total, 2) }} {{ number_format($overtime_hours_total, 2) }} {{ $presents }} {{ $absents }} {{ $late }} {{ $leave }} {{ $holiday }}
@else @if($isHoUser)

@endif
Staff Name Business Present Absent Late Leave Holiday Work Hours Overtime Hours Actions
@endif
@endsection @section('scripts') @vite(['resources/js/app.js']) @endsection