Attendance Report

@foreach($rows as $i => $row) @endforeach
# Date Staff ID Name Branch Checkin Checkout Working Hours Attendance Type Duty Type Salary
{{ $i + 1 }} {{ $row->attendance_date ? \Carbon\Carbon::parse($row->attendance_date)->format('d/m/Y') : '-' }} {{ $row->staff_id ?? '-' }} {{ $row->staff->name ?? '-' }} {{ $row->staff->branch ?? '-' }} {{ $row->attendance_checkin ?? '-' }} {{ $row->attendance_checkout ?? '-' }} @if($row->attendance_checkin && $row->attendance_checkout) @php $ci = \Carbon\Carbon::parse($row->attendance_checkin); $co = \Carbon\Carbon::parse($row->attendance_checkout); if ($co->lessThan($ci)) $co->addDay(); $mins = $ci->diffInMinutes($co); echo sprintf('%02d:%02d', intdiv($mins, 60), $mins % 60); @endphp @else - @endif {{ $row->attendance_type ?? '-' }} {{ $row->duty_type ?? '-' }} {{ $row->calculated_salary ? '₹ ' . $row->calculated_salary : '-' }}
Total Salary ₹ {{ number_format($rows->sum('calculated_salary'), 2) }}