<%
const mns = (lang || 'id') === 'en'
? ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
: ['Jan','Feb','Mar','Apr','Mei','Jun','Jul','Agt','Sep','Okt','Nov','Des'];
const isPaid = invoice.status === 'paid';
const companyInitial = (company || 'A').charAt(0).toUpperCase();
const customerInitial = (customer.name || 'P').charAt(0).toUpperCase();
const invNo = 'INV-' + String(invoice.id).padStart(4, '0') + '-' + getCurrentTimeInfo().year;
const periodStr = mns[invoice.period_month - 1] + ' ' + invoice.period_year;
%>
Ditagihkan Kepada
<%= customer.name %>
<% if (customer.customer_code) { %>
ID Pelanggan: <%= customer.customer_code %>
<% } %>
Informasi Transaksi
<%= t('common.date','Tanggal') %> <%= isPaid ? 'Pembayaran' : 'Tagihan' %>
<%= isPaid && invoice.paid_at ? formatDateLocal(invoice.paid_at) : getNowLocal() %>
Periode Tagihan
<%= periodStr %>
Kasir / Penerima
<%= invoice.paid_by_name || 'Sistem' %>
Metode Pembayaran
<%= invoice.payment_gateway ? invoice.payment_gateway.toUpperCase() : 'Tunai / Transfer' %>
<% if (isPaid) { %>
LUNAS
<% } else { %>
TAGIHAN
<% } %>
| # |
Deskripsi Layanan |
<%= t('pwa.field.period','Periode') %> |
<%= t('common.amount_qty','Jumlah') %> |
| 01 |
Layanan Internet — <%= customer.package_name || 'Paket Internet Broadband' %>
Langganan bulanan internet high-speed
|
<%= periodStr %> |
Rp <%= Number(invoice.amount || 0).toLocaleString('id-ID') %> |
Catatan Pembayaran:
<%= invoice.notes || 'Terima kasih telah berlangganan layanan internet kami. Simpan struk ini sebagai bukti pembayaran yang sah.' %>
<% if (invoice.payment_order_id) { %>
Referensi Transaksi: <%= invoice.payment_order_id %>
<% } %>
Subtotal
Rp <%= Number(invoice.amount_before_discount || invoice.amount || 0).toLocaleString('id-ID') %>
Diskon / Potongan<% if (Number(invoice.discount_amount||0) > 0 && invoice.discount_type==='percent') { %> (<%= invoice.discount_value %>%)<% } %>
<%= Number(invoice.discount_amount||0) > 0 ? ('- Rp ' + Number(invoice.discount_amount).toLocaleString('id-ID')) : 'Rp 0' %>
Total Bayar
Rp <%= Number(invoice.amount || 0).toLocaleString('id-ID') %>
Struk Thermal
Unduh PDF
<% if (customer && customer.phone) { %>
<% } %>