Construction consent/fix event

This commit is contained in:
Luca Haid
2025-03-12 14:01:55 +00:00
parent fc4d70764d
commit 6dc7fc58fc
4 changed files with 31 additions and 13 deletions

View File

@@ -392,8 +392,8 @@
}
$("#kg").change(updateGstnr);
$("#gst").change(updateGstnr);
$("#kg").on("input", updateGstnr);
$("#gst").on("input", updateGstnr);
async function updateGstnr() {
let kg = $("#kg").val();
@@ -404,18 +404,16 @@
$("#gstnr").val(kg + gst);
// update EZ
if($("#object_type").val() == "building") {
$("#ez").prop("readonly", true);
var response = await fetch('<?=self::getUrl("ConstructionConsent", "Api", ["do" => "getEz"])?>&kg=' + kg + '&gst=' + gst);
if (!response.ok) {
return false;
}
var resp_json = await response.json();
if (resp_json.status == "OK" && resp_json.result.ez) {
$("#ez").val(resp_json.result.ez);
}
$("#ez").prop("readonly", false);
$("#ez").prop("readonly", true);
var response = await fetch('<?=self::getUrl("ConstructionConsent", "Api", ["do" => "getEz"])?>&kg=' + kg + '&gst=' + gst);
if (!response.ok) {
return false;
}
var resp_json = await response.json();
if (resp_json.status == "OK" && resp_json.result.ez) {
$("#ez").val(resp_json.result.ez);
}
$("#ez").prop("readonly", false);
}
$(window).bind("paste", (e) => {

View File

@@ -135,6 +135,11 @@ $pagination_entity_name = "Zustimmungserklärungen";
<input type="text" class="form-control" name="filter[ez]" id=filter_ez value="<?=(array_key_exists('ez', $filter)) ? $filter['ez'] : ""?>" />
</div>
<div class="col-2">
<label class="form-label" for="filter_cwo">Eigentümer</label>
<input type="text" class="form-control" name="filter[cwo]" id=filter_cwo value="<?=(array_key_exists('cwo', $filter)) ? $filter['cwo'] : ""?>" />
</div>
</div>