From 003ed5d66ae6d684a6266e7a3e13a80ee3fe947d Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Mon, 12 May 2025 09:41:45 +0200 Subject: [PATCH] add new import columns --- .../ConstructionConsentController.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/application/ConstructionConsent/ConstructionConsentController.php b/application/ConstructionConsent/ConstructionConsentController.php index 73803f836..5acb9d368 100644 --- a/application/ConstructionConsent/ConstructionConsentController.php +++ b/application/ConstructionConsent/ConstructionConsentController.php @@ -1175,6 +1175,9 @@ class ConstructionConsentController extends mfBaseController { 'GST', 'GSTNR', 'RIMO GN', + 'Wohneinheiten', + 'Bestellungen', + 'Anfrageresultat', 'Nutzungslänge', 'Leerrohr am Grundstück', 'Leerrohr im Gebäude', @@ -1211,6 +1214,22 @@ class ConstructionConsentController extends mfBaseController { $item->adb_hausnummer->strasse->gemeinde->name; } + $status_class = 'Blau'; + $approve_override = $item->approve_override; + if (isset($approve_override) && $approve_override) { + $status_class = 'Grün'; + } elseif (isset($item->owner_result_counts['denied']) && $item->owner_result_counts['denied'] > 0) { + $status_class = 'Rot'; + } elseif ( + (isset($item->owner_result_counts['unresolvable']) && $item->owner_result_counts['unresolvable'] > 0) || + (isset($item->owner_result_counts['moved']) && $item->owner_result_counts['moved'] > 0) || + (isset($item->owner_result_counts['open']) && $item->owner_result_counts['open'] > 0) + ) { + $status_class = 'Gelb'; // Yellow if at least one unresolvable or moved + } elseif (isset($item->owner_result_counts['accepted']) && + $item->owner_result_counts['accepted'] === count($item->owners)) { + $status_class = 'Grün'; // Green if all accepted + } $row = [ $item->project->name, @@ -1222,6 +1241,9 @@ class ConstructionConsentController extends mfBaseController { $item->gst, $item->gstnr, $item->rimo_gn, + $item->adb_hausnummer->unit_count ?? '', + $item->preorder_count, + $status_class, $item->usage_length, $item->usage_pipe_on_plot == 1 ? 'Ja' : 'Nein', $item->usage_pipe_in_building == 1 ? 'Ja' : 'Nein',