@extends('layouts.user') @section('title', __('hr.attendance_sheet')) @section('page_title', __('hr.attendance_sheet')) @section('breadcrumb', __('hr.hr_attendance_sheet')) @section('content') @php use Carbon\Carbon; $advanceRowsByDate = collect($advanceRowsByDate ?? []); $totalMonthlyAdvance = (float) ($totalMonthlyAdvance ?? 0); $monthName = Carbon::createFromDate($year, $month, 1)->format('F Y'); $isMonthly = $employee->employee_type === 'monthly'; $isDailyRoz = $employee->employee_type === 'daily_roz'; @endphp
{{-- Header --}}
{{ __('hr.employee_attendance_report') }}

{{ $employee->name }}

{{ $employee->employee_code ?: __('hr.no_code') }} {{ $isDailyRoz ? __('hr.daily_roz_employee') : __('hr.monthly_employee') }} {{ $monthName }}
{{ __('hr.back') }} @if(Route::has('user.hr.attendance.sheet.print')) {{ __('hr.print') }} @endif
{{ __('hr.advance') }}: {{ number_format($totalMonthlyAdvance, 2) }}
{{-- Summary --}}
{{ __('hr.present') }}
{{ $summary['present'] ?? 0 }}
{{ __('hr.absent') }}
{{ $summary['absent'] ?? 0 }}
@if($isMonthly)
{{ __('hr.leave') }}
{{ $summary['leave'] ?? 0 }}
@endif
{{ __('hr.holiday') }}
{{ $summary['holiday'] ?? 0 }}
@if($isMonthly)
{{ __('hr.overtime') }}
{{ number_format((float) ($summary['overtime_hours'] ?? 0), 2) }}
@endif @if($isDailyRoz)
{{ __('hr.total_roz') }}
{{ number_format((float) ($summary['total_roz'] ?? 0), 2) }}
@endif
{{ __('hr.this_month_advance') }}
{{ number_format($totalMonthlyAdvance, 2) }}
{{-- Desktop Table --}} {{-- Mobile Cards --}}
@foreach($days as $day) @php $row = $attendanceRows[$day] ?? null; $advanceItems = collect($advanceRowsByDate[$day] ?? []); $advanceTotal = (float) $advanceItems->sum('amount'); $referenceText = $advanceItems->pluck('reference_no')->filter()->implode(' | '); $advanceNoteText = $advanceItems->pluck('note')->filter()->implode(' | '); $allNotes = collect([$row?->note, $advanceNoteText])->filter()->implode(' | '); @endphp

{{ Carbon::parse($day)->format('d M Y') }}

{{ Carbon::parse($day)->format('l') }}

@if($row) {{ __('hr.status_' . $row->day_status) }} @else {{ __('hr.no_entry') }} @endif
@if($isMonthly)
{{ __('hr.overtime') }}
{{ $row ? number_format((float) $row->overtime_hours, 2) : __('hr.dash') }}
@endif @if($isDailyRoz)
{{ __('hr.roz') }}
{{ $row ? number_format((float) $row->roz_value, 2) : __('hr.dash') }}
@endif
{{ __('hr.advance') }}
{{ $advanceTotal > 0 ? number_format($advanceTotal, 2) : __('hr.dash') }}
{{ __('hr.reference') }}
{{ $referenceText !== '' ? $referenceText : __('hr.dash') }}
{{ __('hr.note') }}
{{ $allNotes !== '' ? $allNotes : __('hr.dash') }}
@endforeach
@endsection