Generate & preview nomor voucher GLC-AS · Payment Approval System
046/GLC-AS/PB/IX/2026AS2609-001/**
* Google Payment Approval System — Voucher Number Generation
* Auto-generated reference. Contoh saat ini:
* Payment Voucher -> 046/GLC-AS/PB/IX/2026
* Rekap -> AS2609-001
*/
// 01=I, 02=II, ... 12=XII
function monthToRoman(month) {
const map = ['', 'I', 'II', 'III', 'IV', 'V', 'VI',
'VII', 'VIII', 'IX', 'X', 'XI', 'XII'];
return map[month] || '';
}
function pad(value, length) {
return String(value).padStart(length, '0');
}
// Format: (No)/GLC-AS/PB/(bulan romawi)/(tahun)
// Contoh: 046/GLC-AS/PB/VIII/2026
function generateVoucherNumber(sequence, month, year) {
return pad(sequence, 3) + '/GLC-AS/PB/' + monthToRoman(month) + '/' + year;
}
// Format: AS(TAHUN)(BULAN)-(NOMOR URUT) [reset tiap bulan]
// Contoh: AS2609-001
function generateRekapNumber(sequence, month, year) {
const yy = String(year).slice(-2);
return 'AS' + yy + pad(month, 2) + '-' + pad(sequence, 3);
}