Merge branch 'fronkdev' into 'master'

Added ADB Gwrgst table and auto EZ in ConstructionConsent

See merge request fronk/thetool!1055
This commit is contained in:
Frank Schubert
2025-02-27 17:09:44 +00:00
4 changed files with 351 additions and 8 deletions

View File

@@ -90,13 +90,6 @@
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="ez">Grundbuch Einlagezahl EZ</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="ez" id="ez" value="<?=(isset($item)) ? $item->ez : ""?>" />
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="kg">KG</label>
<div class="col-lg-10">
@@ -118,6 +111,13 @@
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="ez">Grundbuch Einlagezahl EZ</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="ez" id="ez" value="<?=(isset($item)) ? $item->ez : ""?>" />
</div>
</div>
<hr />
<div id="usage-container">
@@ -395,13 +395,24 @@
$("#kg").change(updateGstnr);
$("#gst").change(updateGstnr);
function updateGstnr() {
async function updateGstnr() {
let kg = $("#kg").val();
let gst = $("#gst").val();
if(!kg || !gst) return;
$("#gstnr").val(kg + gst);
// update EZ
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);
}
}
$(window).bind("paste", (e) => {