added POST /preorder Api

This commit is contained in:
Frank Schubert
2022-09-15 14:15:00 +02:00
parent 2cbdbf3813
commit 824f3a6ef2
6 changed files with 86 additions and 17 deletions
+15 -1
View File
@@ -301,7 +301,6 @@
}
$("#product_id").select2({
allowClear: true,
placeholder: ""
@@ -392,6 +391,7 @@
.data("tuer", unit.tuer)
.data("zusatz", unit.zusatz);
afterHausnummerChange();
});
@@ -453,10 +453,24 @@
}
});
<?php if($preorder->adb_hausnummer_id): ?>
console.log("Hausnummer");
$('#adb_hausnummer_id').trigger("change");
// afterHausnummerChange() will be called by change event
<?php endif; ?>
});
function afterHausnummerChange() {
<?php if($preorder->adb_wohneinheit_id): ?>
console.log("selecting wohneinheit");
$('#adb_wohneinheit_id option[value=<?=$preorder->adb_wohneinheit_id?>]').prop("selected", true);
$('#adb_wohneinheit_id').trigger("change");
<?php endif; ?>
}
function updateSetupProduct(type) {
if(type == "provision") {
$('#setup_product_id').val($("#setup-provision select").val());
+1 -1
View File
@@ -55,7 +55,7 @@
<td>
<?=$preorder->adb_hausnummer->strasse->name?>
<?=$preorder->adb_hausnummer->hausnummer?><br />
<?=($preorder->adb_wohneinheit_id) ? $preorder->adb_wohneinheit."<br />" : ""?>
<?=($preorder->adb_wohneinheit_id) ? ((string)$preorder->adb_wohneinheit ? $preorder->adb_wohneinheit."<br />" : "") : "<i class='text-pink'>&lt;keine Wohneinheit&gt;</i><br />"?>
<?=$preorder->adb_hausnummer->plz->plz?>
<?=$preorder->adb_hausnummer->strasse->ortschaft->name?>
</td>