<%- include('partials/sidebar', { activePage: 'collector_payments', company }) %>
Approval Pembayaran Kolektor
<%= (typeof session !== 'undefined' && session.isCashier) ? t('admin.role.cashier', 'Kasir') : t('admin.role.admin', 'Admin') %> Pending Approved Rejected
<% if (msg) { %>
<%= msg.text %>
<% } %>
Daftar Request (<%= (rows || []).length %>)
Label proses membantu membedakan request yang memang menunggu approval, request yang otomatis langsung lunas oleh kolektor, dan request yang sudah diproses admin atau kasir.
<% if (!rows || rows.length === 0) { %> <% } else { %> <% rows.forEach(r => { %> <% const decidedRole = String(r.decided_by_role || '').toLowerCase(); const processLabel = r.status === 'pending' ? 'Butuh Approval' : decidedRole === 'system' ? 'Auto Kolektor' : decidedRole === 'cashier' ? 'Disetujui Kasir' : decidedRole === 'admin' ? 'Disetujui Admin' : r.status === 'rejected' ? 'Ditolak Manual' : 'Diproses Manual'; const processBadge = r.status === 'pending' ? 'bm' : decidedRole === 'system' ? 'bs' : decidedRole === 'cashier' || decidedRole === 'admin' ? 'bp' : r.status === 'rejected' ? 'bd' : 'bm'; %> <% }) %> <% } %>
<%= t('collector.col_time','Waktu') %> <%= t('collector.role','Kolektor') %> <%= t('common.customer','Pelanggan') %> Tagihan <%= t('collector.col_amount','Nominal') %> Proses <%= t('common.status','Status') %> <%= t('common.actions','Aksi') %>
Tidak ada request.
<%= r.created_at ? new Date(r.created_at).toLocaleString('id-ID',{day:'2-digit',month:'short',hour:'2-digit',minute:'2-digit'}) : '-' %> <%= r.collector_name %> <%= r.collector_username ? '(@'+r.collector_username+')' : '' %>
<%= r.customer_name %>
<%= r.customer_phone || '' %>
Invoice #<%= r.invoice_id %> • <%= r.period_month %>/<%= r.period_year %>
<%= r.invoice_status %> • Rp <%= Number(r.invoice_amount||0).toLocaleString('id-ID') %>
<% if (r.customer_address) { %>
<%= r.customer_address %>
<% } %> <% if (r.lat && r.lng) { %><% } %>
Rp <%= Number(r.amount||0).toLocaleString('id-ID') %> <%= processLabel %> <% if (decidedRole === 'system') { %>
Kolektor auto-approve aktif
<% } else if (r.status === 'pending') { %>
Menunggu admin atau kasir
<% } else if (r.decided_by_name) { %>
Oleh: <%= r.decided_by_name %>
<% } %>
<%= String(r.status||'').toUpperCase() %> <% if (r.note) { %>
<%= r.note %>
<% } %> <% if (r.decided_by_name) { %>
Diproses: <%= r.decided_by_name %>
<% } %> <% if (r.decided_note) { %>
<%= r.decided_note %>
<% } %>
<% if (status === 'pending') { %>
<% } else { %> #<%= r.id %> <% } %>