<%- include('partials/sidebar', { activePage: 'attendance', company }) %>
<%= title %>
<%= (typeof session !== 'undefined' && session.isCashier) ? t('admin.role.cashier', 'Kasir') : t('admin.role.admin', 'Admin') %>
<% if (msg) { %>
<%= msg.text %>
<% } %>
<% const techStats = stats.find(s => s.employee_type === 'technician') || {}; const adminStats = stats.find(s => s.employee_type === 'admin') || {}; const cashierStats = stats.find(s => s.employee_type === 'cashier') || {}; const collectorStats = stats.find(s => s.employee_type === 'collector') || {}; const totalAll = (techStats.total || 0) + (adminStats.total || 0) + (cashierStats.total || 0) + (collectorStats.total || 0); const checkedInAll = (techStats.checked_in || 0) + (adminStats.checked_in || 0) + (cashierStats.checked_in || 0) + (collectorStats.checked_in || 0); const checkedOutAll = (techStats.checked_out || 0) + (adminStats.checked_out || 0) + (cashierStats.checked_out || 0) + (collectorStats.checked_out || 0); %>
<%= t('admin.att.total_staff','Total Karyawan') %>
<%= totalAll %>
<%= t('admin.att.today','Hari ini') %>
<%= t('admin.att.working','Sedang Bekerja') %>
<%= checkedInAll %>
Check-in
<%= t('admin.att.checked_out','Sudah Pulang') %>
<%= checkedOutAll %>
Check-out
<%= t('admin.att.late','Terlambat') %>
<%= lateCheckIns.length %>
<%= t('admin.att.after_0830','Setelah 08:30') %>
<%= t('admin.att.technician','Teknisi') %>
<%= techStats.total || 0 %>
<%= techStats.checked_in || 0 %> aktif • <%= techStats.checked_out || 0 %> selesai
Admin
<%= adminStats.total || 0 %>
<%= adminStats.checked_in || 0 %> aktif • <%= adminStats.checked_out || 0 %> selesai
<%= t('admin.att.cashier','Kasir') %>
<%= cashierStats.total || 0 %>
<%= cashierStats.checked_in || 0 %> aktif • <%= cashierStats.checked_out || 0 %> selesai
<%= t('collector.role','Kolektor') %>
<%= collectorStats.total || 0 %>
<%= collectorStats.checked_in || 0 %> aktif • <%= collectorStats.checked_out || 0 %> selesai
<% if (lateCheckIns.length > 0) { %>
<%= t('admin.att.late_checkin','Terlambat Check-in') %> (<%= lateCheckIns.length %>)
<% lateCheckIns.forEach(att => { const checkInTime = parseDateInTimezone(att.check_in_time); const targetTime = new Date(checkInTime); targetTime.setHours(8, 30, 0, 0); const lateMinutes = Math.floor((checkInTime - targetTime) / 1000 / 60); %> <% }) %>
<%= t('pwa.field.name','Nama') %> <%= t('common.type','Tipe') %> <%= t('admin.att.checkin_time','Waktu Check-in') %> <%= t('admin.att.late','Terlambat') %>
<%= att.employee_name %> <%= att.employee_type %> <%= formatTimeLocal(att.check_in_time) %> <%= lateMinutes %> menit
<% } %> <% if (notCheckedOut.length > 0) { %>
<%= t('admin.att.not_checkout','Belum Check-out') %> (<%= notCheckedOut.length %>)
<% notCheckedOut.forEach(att => { const checkInTime = parseDateInTimezone(att.check_in_time); const now = new Date(); const durationMinutes = Math.floor((now - checkInTime) / 1000 / 60); const hours = Math.floor(durationMinutes / 60); const minutes = durationMinutes % 60; %> <% }) %>
<%= t('pwa.field.name','Nama') %> <%= t('common.type','Tipe') %> Check-in <%= t('admin.att.duration','Durasi') %>
<%= att.employee_name %> <%= att.employee_type %> <%= formatTimeLocal(att.check_in_time) %> <%= hours %> jam <%= minutes %> menit
<% } %>
<%= t('admin.att.all_attendance','Semua Absensi') %> - <%= parseDateInTimezone(selectedDate).toLocaleDateString('id-ID', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }) %>
<% if (attendances.length > 0) { %>
<% attendances.forEach(att => { %> <% }) %>
<%= t('pwa.field.name','Nama') %> <%= t('common.type','Tipe') %> Check-in Check-out <%= t('admin.att.duration','Durasi') %> <%= t('common.status','Status') %> <%= t('admin.att.location','Lokasi') %> <%= t('admin.att.photo','Foto') %> <%= t('common.actions','Aksi') %>
<%= att.employee_name %> <%= att.employee_type %> <%= formatTimeLocal(att.check_in_time) %> <% if (att.check_in_note) { %>
<%= att.check_in_note %>
<% } %>
<% if (att.check_out_time) { %> <%= formatTimeLocal(att.check_out_time) %> <% if (att.check_out_note) { %>
<%= att.check_out_note %>
<% } %> <% } else { %> - <% } %>
<% if (att.work_duration_minutes > 0) { %> <%= Math.floor(att.work_duration_minutes / 60) %>j <%= att.work_duration_minutes % 60 %>m <% } else { %> - <% } %> <% if (att.status === 'checked_in') { %> <%= t('common.active','Aktif') %> <% } else { %> Selesai <% } %> <% if (att.check_in_lat && att.check_in_lng) { %> Lihat Map <% } else { %> - <% } %> <% if (att.check_in_photo || att.check_out_photo) { %>
<% if (att.check_in_photo) { %> <%= t('admin.att.photo','Foto') %> check-in In <% } %> <% if (att.check_out_photo) { %> <%= t('admin.att.photo','Foto') %> check-out Out <% } %>
<% } else { %> - <% } %>
<% } else { %>

Tidak ada data absensi

Belum ada karyawan yang melakukan absensi pada tanggal ini.

<% } %>