mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Invoice issuer address: Add state field (#5603)
* Invoice issuer address: Add state field * Update src/pretix/base/settings.py Co-authored-by: Richard Schreiber <schreiber@rami.io> * Update src/pretix/base/models/invoices.py Co-authored-by: Richard Schreiber <schreiber@rami.io> --------- Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -5,6 +5,14 @@ $(function () {
|
||||
// to prevent fetching the same thing many times.
|
||||
var responseCache = {};
|
||||
|
||||
const cleanName = (name) => {
|
||||
// Remove form prefix
|
||||
name = name.split("-").pop();
|
||||
// Remove settings prefix
|
||||
name = name.replace(/^invoice_address_from_/, "");
|
||||
return name
|
||||
}
|
||||
|
||||
$("[data-address-information-url]").each(function () {
|
||||
let xhr;
|
||||
const form = $(this);
|
||||
@@ -22,7 +30,7 @@ $(function () {
|
||||
};
|
||||
|
||||
form.find("select[name*=transmission_], textarea[name*=transmission_], input[name*=transmission_]").each(function () {
|
||||
dependents[$(this).attr("name").split("-").pop()] = $(this)
|
||||
dependents[cleanName($(this).attr("name"))] = $(this)
|
||||
})
|
||||
|
||||
if (!Object.values(dependents).some((el) => el.length)) {
|
||||
@@ -109,7 +117,7 @@ $(function () {
|
||||
if (($(this).attr("type") === "radio" || $(this).attr("type") === "checkbox") && !$(this).prop("checked")) {
|
||||
return
|
||||
}
|
||||
url.searchParams.append($(this).attr("name").split("-").pop(), $(this).val());
|
||||
url.searchParams.append(cleanName($(this).attr("name")), $(this).val());
|
||||
})
|
||||
if (dependents.transmission_type) {
|
||||
url.searchParams.append("transmission_type_required", !dependents.transmission_type.find("option[value='-']").length);
|
||||
|
||||
Reference in New Issue
Block a user