Allow to add a prefix when generating voucher codes (#518)

This commit is contained in:
Tobias Kunze
2017-06-16 23:21:23 +02:00
committed by Raphael Michel
parent 8e3cc0df0c
commit 8fa490c938
4 changed files with 11 additions and 5 deletions

View File

@@ -105,11 +105,11 @@ $(function () {
// Vouchers
$("#voucher-bulk-codes-generate").click(function () {
var num = $("#voucher-bulk-codes-num").val();
var prefix = $('#voucher-bulk-codes-prefix').val();
if (num != "") {
$(".form-group:has(#voucher-bulk-codes-num)").addClass("has-error");
var url = $(this).attr("data-rng-url");
$("#id_codes").html("Generating...");
$.getJSON(url + '?num=' + num, function (data) {
$.getJSON(url + '?num=' + num + '&prefix=' + escape(prefix), function (data) {
$("#id_codes").val(data.codes.join("\n"));
});
} else {