<%- include('partials/sidebar', { activePage: 'vouchers', company }) %>
<%= t('admin.print_vouchers.title', 'Cetak Voucher Batch') %> #<%= batch.id %>
<% function formatValidity(v) { if (!v) return '-'; const s = String(v).trim(); const mDay = s.match(/^(\d+)\s*d$/i); if (mDay) { const n = Number(mDay[1]); if ((lang || 'id') === 'en') return n + (n === 1 ? ' day' : ' days'); return n + ' ' + t('admin.print_vouchers.days', 'hari'); } const mHour = s.match(/^(\d+)\s*h$/i); if (mHour) { return mHour[1] + ' Jam'; } return s; } %> <% if (templateError) { %>
Template Print: <%= templateError %>
<% } %> <% if (style === 'template' && renderedHtml) { %>
<%- renderedHtml %>
<% } else { %>
<% vouchers.forEach(v => { %>
<%= settings.company_header || company %>
<%= batch.package_name || 'Voucher Hotspot' %>
<% if (v.code !== v.password) { %>
<%= t('admin.print_vouchers.hint_user_pass', 'User & Pass') %>
<% } else { %>
Login Hotspot
<% } %>
Rp <%= Number(batch.price || 0).toLocaleString('id-ID') %>
<% if (v.code === v.password) { %>
<%= v.code %>
<%= formatValidity(batch.validity) %>
<% } else { %>
U: <%= v.code %>
P: <%= v.password %>
<%= formatValidity(batch.validity) %>
<% } %>
<% }) %>
<% } %>