<% 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 %>)
| <%= t('pwa.field.name','Nama') %> |
<%= t('common.type','Tipe') %> |
<%= t('admin.att.checkin_time','Waktu Check-in') %> |
<%= t('admin.att.late','Terlambat') %> |
<% 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);
%>
| <%= 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 %>)
| <%= t('pwa.field.name','Nama') %> |
<%= t('common.type','Tipe') %> |
Check-in |
<%= t('admin.att.duration','Durasi') %> |
<% 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;
%>
| <%= 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) { %>
| <%= 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') %> |
<% attendances.forEach(att => { %>
| <%= 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) { %>
In
<% } %>
<% if (att.check_out_photo) { %>
Out
<% } %>
<% } else { %>
-
<% } %>
|
|
<% }) %>
<% } else { %>
Tidak ada data absensi
Belum ada karyawan yang melakukan absensi pada tanggal ini.
<% } %>