Added rimo_gn to ConstructionConsent

This commit is contained in:
Frank Schubert
2025-04-15 15:59:54 +02:00
parent 2bbd1292cf
commit e2351d1f3d
6 changed files with 59 additions and 3 deletions

View File

@@ -122,6 +122,13 @@
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="rimo_gn">Rimo GN</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="rimo_gn" id="rimo_gn" value="<?=(isset($item)) ? $item->rimo_gn : ""?>" />
</div>
</div>
<hr />
<div id="usage-container">

View File

@@ -134,16 +134,21 @@ $pagination_entity_name = "Zustimmungserklärungen";
<input type="text" class="form-control" name="filter[address]" id="filter_address" value="<?=(array_key_exists('address', $filter)) ? $filter['address'] : ""?>" />
</div>
<div class="col-2">
<div class="col-1">
<label class="form-label" for="filter_gst">GST</label>
<input type="text" class="form-control" name="filter[gst]" id=filter_gst value="<?=(array_key_exists('gst', $filter)) ? $filter['gst'] : ""?>" />
</div>
<div class="col-2">
<div class="col-1">
<label class="form-label" for="filter_gst">EZ</label>
<input type="text" class="form-control" name="filter[ez]" id=filter_ez value="<?=(array_key_exists('ez', $filter)) ? $filter['ez'] : ""?>" />
</div>
<div class="col-1">
<label class="form-label" for="filter_rimo_gn">Rimo GN</label>
<input type="text" class="form-control" name="filter[rimo_gn]" id=filter_rimo_gn value="<?=(array_key_exists('rimo_gn', $filter)) ? $filter['rimo_gn'] : ""?>" />
</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'] : ""?>" />

View File

@@ -184,6 +184,9 @@ $pagination_entity_name = "Adressen";
</tr><tr>
<th>GSTNR</th>
<td><?=$item->gstnr?></td>
</tr><tr>
<th>Rimo GN</th>
<td><?=$item->rimo_gn?></td>
</tr><tr>
<th>Plan/Skizze</th>
<td>

View File

@@ -309,7 +309,7 @@ class ConstructionConsent extends mfBaseModel {
$table_fields = [
"constructionconsentproject_id", "termination_id","adb_hausnummer_id", "adb_strasse_id", "object_type", "name", "ez", "kg", "gst", "gstnr",
"usage_length", "usage_pipe_on_plot", "usage_pipe_in_building", "usage_manhole", "usage_owner",
"rimo_gn", "usage_length", "usage_pipe_on_plot", "usage_pipe_in_building", "usage_manhole", "usage_owner",
"status", "result", "result_text", "note", "create_by","edit_by","create","edit"
];
@@ -508,6 +508,13 @@ FROM ConstructionConsent
}
}
if(array_key_exists("rimo_gn", $filter)) {
$rimo_gn = FronkDB::singleton()->escape($filter["rimo_gn"]);
if($rimo_gn) {
$where .= " AND rimo_gn LIKE '%$rimo_gn%'";
}
}
if(array_key_exists("address", $filter)) {
$address = FronkDB::singleton()->escape($filter["address"]);
if ($address) {

View File

@@ -252,6 +252,7 @@ class ConstructionConsentController extends mfBaseController {
$data["kg"] = $r->kg;
$data["gst"] = $r->gst;
$data["gstnr"] = $r->gstnr;
$data["rimo_gn"] = $r->rimo_gn;
$data["usage_length"] = $r->usage_length ?: null;
$data["usage_pipe_on_plot"] = $r->usage_pipe_on_plot ? 1 : 0;
$data["usage_pipe_in_building"] = $r->usage_pipe_in_building ? 1 : 0;

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class ConstructionConsentAddRimoGn extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('ConstructionConsent');
$table->addColumn('rimo_gn', 'string', ['limit' => 64, 'null' => true, 'default' => null, "after" => "gstnr"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('ConstructionConsent');
$table->removeColumn('rimo_gn');
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}