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>

View File

@@ -580,6 +580,13 @@ class ConstructionConsent extends mfBaseModel {
}
}
if (array_key_exists("cwo", $filter)) {
$where .= " AND EXISTS
(SELECT 1 FROM ConstructionConsentOwner co WHERE co.constructionconsent_id = ConstructionConsent.id AND
(co.firstname LIKE '%".$filter['cwo']."%' OR co.lastname LIKE '%".$filter['cwo']."%'))";
}
if(array_key_exists("add-where", $filter)) {

View File

@@ -5,6 +5,14 @@
// phpinfo(); exit;
define('mfUI',"web");
// set max memory to 4GB
ini_set('memory_limit', '4096M');
//display errors
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('error_reporting', E_ALL);
if(file_exists("../config/config.php")) {
require("../config/config.php");
} else {