Use local function for generating the voucher code.