diff --git a/Layout/default/Preorder/Index.php b/Layout/default/Preorder/Index.php index dc08e6ca6..29be094ab 100644 --- a/Layout/default/Preorder/Index.php +++ b/Layout/default/Preorder/Index.php @@ -239,7 +239,7 @@ Partner Attribute Erstellt
Bearbeitet - is(["Admin","netowner"]) && $campaign->fulfillment == "rimo"): ?> + is(["Admin","netowner"])): ?> @@ -295,7 +295,7 @@ edit)?> - is(["Admin", "netowner"]) && $campaign->fulfillment == "rimo"): ?> + is(["Admin", "netowner"])): ?> adb_wohneinheit_id && is_object($preorder->adb_wohneinheit->rimo_workorder)):?> diff --git a/Layout/default/Preorder/include/preorder-detail.php b/Layout/default/Preorder/include/preorder-detail.php index dfb5b3a66..07e3120c0 100644 --- a/Layout/default/Preorder/include/preorder-detail.php +++ b/Layout/default/Preorder/include/preorder-detail.php @@ -210,6 +210,9 @@ Gemeinde adb_hausnummer->strasse->gemeinde->name?> + + Anzahl Wohneinheiten + adb_hausnummer->wohneinheiten) && count($preorder->adb_hausnummer->wohneinheiten)) ? count($preorder->adb_hausnummer->wohneinheiten) : "0"?> diff --git a/scripts/adb-rimo-import/ADBAddressHelper/Network/Network-C03070-st-stefan-ob-stainz.php b/scripts/adb-rimo-import/ADBAddressHelper/Network/Network-C03070-st-stefan-ob-stainz.php new file mode 100644 index 000000000..3ad57a500 --- /dev/null +++ b/scripts/adb-rimo-import/ADBAddressHelper/Network/Network-C03070-st-stefan-ob-stainz.php @@ -0,0 +1,49 @@ +item as $cluster) { } - /*if($cluster_rimo_id != "SDISalesCluster_200193309697_1700559530") { - // kalwang + if($cluster_rimo_id != "SDISalesCluster_40295863041_1679040094") { + // st. stefan ob stainz continue; - }*/ + } $AddressHelper = new ADBAddressHelper\AddressHelper(["log" => $log, "db" => $adb, "netzgebiet" => $adb_netzgebiet]); @@ -170,14 +170,14 @@ foreach($clustersResponse->item as $cluster) { $home_rimo_id = $home->id; $home_name = $home->name; - echo "$home_rimo_id\n"; + //echo "$home_rimo_id\n"; if(array_key_exists($home_rimo_id, $existing_units)) { $unit = $existing_units[$home_rimo_id]; } else { // find free home without rimo_id $unit = \ADBWohneinheitModel::getFirst(["hausnummer_id" => $hausnummer->id, "extref" => null]); - echo "-- Using free unit\n"; + //echo "-- Using free unit\n"; } if(!$unit) { @@ -289,12 +289,12 @@ foreach($clustersResponse->item as $cluster) { $req_url = $epGetService."?".$qs; $req_ctx = stream_context_create($ctxOptsGet); - echo $req_url."\n"; + //echo $req_url."\n"; $responseText = file_get_contents($req_url, false, $req_ctx); if($responseText === false) { - echo "Error fetching Service for Home $home_rimo_id\n"; - exit; + //echo "Error fetching Service for Home $home_rimo_id\n"; + continue; } $serviceResponse = json_decode($responseText); @@ -307,7 +307,7 @@ foreach($clustersResponse->item as $cluster) { $fixedDN = $service->portA->fixEndDN; if($fixedDN) { - echo "fixedDn found: $fixedDN\n"; + //echo "fixedDn found: $fixedDN\n"; $dn = getServiceDnValues($fixedDN); if(array_key_exists("Shelf", $dn) && array_key_exists("PatchPanel", $dn) && array_key_exists("Port", $dn)) { $cluster = null; @@ -350,12 +350,12 @@ foreach($clustersResponse->item as $cluster) { $req_url = $epGetWorkorders."?".$qs; $req_ctx = stream_context_create($ctxOptsGet); - echo $req_url."\n"; + //echo $req_url."\n"; $responseText = file_get_contents($req_url, false, $req_ctx); if($responseText === false) { - echo "Error fetching Workorders for building $rimo_building_id\n"; - exit; + //echo "Error fetching Workorders for building $rimo_building_id\n"; + continue; } $workordersResponse = json_decode($responseText); @@ -372,7 +372,7 @@ foreach($clustersResponse->item as $cluster) { $wo = \RimoWorkorderModel::getFirst(["rimo_id" => $rimo_workorder_id]); if($wo && $workorder_status != $wo->rimo_status) { - echo "Updating Workorder $rimo_workorder_id ($workorder_home_id)\n"; + //echo "Updating Workorder $rimo_workorder_id ($workorder_home_id)\n"; $wo->rimo_status = $workorder_status; $wo->save(); } @@ -381,11 +381,11 @@ foreach($clustersResponse->item as $cluster) { $wo_home = \ADBWohneinheitModel::getFirst(["extref" => $workorder_home_id]); if(!$wo_home) { - echo "Home zu Workorder $rimo_workorder_id ($workorder_home_id) nicht gefunden\n"; + //echo "Home zu Workorder $rimo_workorder_id ($workorder_home_id) nicht gefunden\n"; continue; } - echo "Creating Workorder $rimo_workorder_id ($workorder_home_id)\n"; + //echo "Creating Workorder $rimo_workorder_id ($workorder_home_id)\n"; $wo = \RimoWorkorderModel::create([ "adb_wohneinheit_id" => $wo_home->id, "rimo_id" => $rimo_workorder_id, diff --git a/scripts/adb-rimo-import/sample-home.txt b/scripts/adb-rimo-import/sample-home.txt deleted file mode 100644 index bc4f7ba29..000000000 --- a/scripts/adb-rimo-import/sample-home.txt +++ /dev/null @@ -1,356 +0,0 @@ -https://rimo-saas.com/CRM2RIMO/prod/getBuildings?apiKey=323D33323DC0F8D96BB3C403324D1B7B2F7294FEF981ACF2059BE2B3ACB80EA389D079918FFBAD831861C1850F4046AB&clusterId=SDISalesCluster_126657212929_1678961358 -=================================== -strasse: Bierbaum | hausnummer: 62 | zusatz: | gemkz: 60670 | gem_name: Premstätten | ort_name: Bierbaum | plz_name: 8141 -found hausnummer from rimo_id SDIBuilding_689339860481_1617191662 -stdClass Object -( - [id] => SDIHome_63149132801_1664900169 - [name] => 25011048.01 - [userLabel] => - [lastHistoryEntry] => - [className] => - [executionState] => stdClass Object - ( - [name] => 3 - [userLabel] => Plan released - ) - - [operationalState] => stdClass Object - ( - [name] => 10 - [userLabel] => Planned - ) - - [subAddress] => - [ftus] => stdClass Object - ( - [item] => Array - ( - [0] => stdClass Object - ( - [id] => SDMMaterial_63149135105_0 - [name] => G241.01 - [userLabel] => - [lastHistoryEntry] => - [className] => - [oaidObject] => stdClass Object - ( - [id] => SDIOAIDObject_277465606401_1698935360 - [name] => KWD7M4L0 - [userLabel] => - [lastHistoryEntry] => 1698935360 - [className] => SDIOAIDObject - [terminiationUnit] => - [linkObjects] => stdClass Object - ( - [id] => - [name] => - [userLabel] => - [lastHistoryEntry] => - [className] => - [item] => Array - ( - [0] => stdClass Object - ( - [id] => - [name] => KWD7M4L0.001 - [userLabel] => - [lastHistoryEntry] => - [className] => - [terminiationUnit] => stdClass Object - ( - [id] => SDMPort_63149135617_1698935360 - [name] => 1 - [userLabel] => - [lastHistoryEntry] => - [className] => - [oaidObject] => - ) - - [linkObjects] => - [oaidObject] => - [portZ] => stdClass Object - ( - [id] => - [name] => 1 - [userLabel] => - [lastHistoryEntry] => - [className] => - [functionalState] => stdClass Object - ( - [name] => 1 - [userLabel] => Good - ) - - [masterItem] => stdClass Object - ( - [id] => - [name] => SC/APC - [userLabel] => - [lastHistoryEntry] => - [className] => - ) - - [fixEndDN] => root{SDMRoot}:Locations{SDILocationRoot}:Austria{SDICountry}:ST{SDIState}:GU{SDIPoliticalDistrict}:60670{SDIMunicipality}:63206{SDICadastralMunicipality}:1168927{SDIBuilding}:25011048.01{SDIHome}:G241.01{TerminationDevice}:1{Port} - [home] => - [parent] => - ) - - [services] => stdClass Object - ( - [item] => Array - ( - [0] => stdClass Object - ( - [id] => SDIService_63157655297_1664900174 - [name] => 108SL1 - [userLabel] => - [lastHistoryEntry] => 1664900174 - [className] => SDIService - [operationalState] => stdClass Object - ( - [name] => 10 - [userLabel] => Planned - ) - - [masterItem] => stdClass Object - ( - [id] => SDMServiceMasterItem_1025929847553_0 - [name] => FTTx Service (red) - [userLabel] => - [lastHistoryEntry] => 1664892065 - [className] => SDMServiceMasterItem - ) - - [active] => - [state] => stdClass Object - ( - [name] => 1 - [userLabel] => undefined - ) - - [customerId] => - [customerState] => - ) - - ) - - ) - - ) - - [1] => stdClass Object - ( - [id] => - [name] => KWD7M4L0.002 - [userLabel] => - [lastHistoryEntry] => - [className] => - [terminiationUnit] => stdClass Object - ( - [id] => SDMPort_63149136641_1698935360 - [name] => 2 - [userLabel] => - [lastHistoryEntry] => - [className] => - [oaidObject] => - ) - - [linkObjects] => - [oaidObject] => - [portZ] => stdClass Object - ( - [id] => - [name] => 2 - [userLabel] => - [lastHistoryEntry] => - [className] => - [functionalState] => stdClass Object - ( - [name] => 1 - [userLabel] => Good - ) - - [masterItem] => stdClass Object - ( - [id] => - [name] => SC/APC - [userLabel] => - [lastHistoryEntry] => - [className] => - ) - - [fixEndDN] => root{SDMRoot}:Locations{SDILocationRoot}:Austria{SDICountry}:ST{SDIState}:GU{SDIPoliticalDistrict}:60670{SDIMunicipality}:63206{SDICadastralMunicipality}:1168927{SDIBuilding}:25011048.01{SDIHome}:G241.01{TerminationDevice}:2{Port} - [home] => - [parent] => - ) - - [services] => stdClass Object - ( - [item] => Array - ( - [0] => stdClass Object - ( - [id] => SDIService_63157653249_1664900174 - [name] => 108SL2 - [userLabel] => - [lastHistoryEntry] => 1664900174 - [className] => SDIService - [operationalState] => stdClass Object - ( - [name] => 10 - [userLabel] => Planned - ) - - [masterItem] => stdClass Object - ( - [id] => SDMServiceMasterItem_1025929848833_0 - [name] => FTTx Service (blue) - [userLabel] => - [lastHistoryEntry] => 1664892070 - [className] => SDMServiceMasterItem - ) - - [active] => - [state] => stdClass Object - ( - [name] => 1 - [userLabel] => undefined - ) - - [customerId] => - [customerState] => - ) - - ) - - ) - - ) - - [2] => stdClass Object - ( - [id] => - [name] => KWD7M4L0.003 - [userLabel] => - [lastHistoryEntry] => - [className] => - [terminiationUnit] => stdClass Object - ( - [id] => SDMPort_63149136897_1698935360 - [name] => 3 - [userLabel] => - [lastHistoryEntry] => - [className] => - [oaidObject] => - ) - - [linkObjects] => - [oaidObject] => - [portZ] => stdClass Object - ( - [id] => - [name] => 3 - [userLabel] => - [lastHistoryEntry] => - [className] => - [functionalState] => stdClass Object - ( - [name] => 1 - [userLabel] => Good - ) - - [masterItem] => stdClass Object - ( - [id] => - [name] => SC/APC - [userLabel] => - [lastHistoryEntry] => - [className] => - ) - - [fixEndDN] => root{SDMRoot}:Locations{SDILocationRoot}:Austria{SDICountry}:ST{SDIState}:GU{SDIPoliticalDistrict}:60670{SDIMunicipality}:63206{SDICadastralMunicipality}:1168927{SDIBuilding}:25011048.01{SDIHome}:G241.01{TerminationDevice}:3{Port} - [home] => - [parent] => - ) - - [services] => stdClass Object - ( - [item] => Array - ( - ) - - ) - - ) - - [3] => stdClass Object - ( - [id] => - [name] => KWD7M4L0.004 - [userLabel] => - [lastHistoryEntry] => - [className] => - [terminiationUnit] => stdClass Object - ( - [id] => SDMPort_63149157889_1698935360 - [name] => 4 - [userLabel] => - [lastHistoryEntry] => - [className] => - [oaidObject] => - ) - - [linkObjects] => - [oaidObject] => - [portZ] => stdClass Object - ( - [id] => - [name] => 4 - [userLabel] => - [lastHistoryEntry] => - [className] => - [functionalState] => stdClass Object - ( - [name] => 1 - [userLabel] => Good - ) - - [masterItem] => stdClass Object - ( - [id] => - [name] => SC/APC - [userLabel] => - [lastHistoryEntry] => - [className] => - ) - - [fixEndDN] => root{SDMRoot}:Locations{SDILocationRoot}:Austria{SDICountry}:ST{SDIState}:GU{SDIPoliticalDistrict}:60670{SDIMunicipality}:63206{SDICadastralMunicipality}:1168927{SDIBuilding}:25011048.01{SDIHome}:G241.01{TerminationDevice}:4{Port} - [home] => - [parent] => - ) - - [services] => stdClass Object - ( - [item] => Array - ( - ) - - ) - - ) - - ) - - ) - - ) - - ) - - ) - - ) - -) - diff --git a/scripts/preorder/preorders-split-multiple-connections.php b/scripts/preorder/preorders-split-multiple-connections.php index a9aa35321..9e7c58237 100755 --- a/scripts/preorder/preorders-split-multiple-connections.php +++ b/scripts/preorder/preorders-split-multiple-connections.php @@ -21,8 +21,9 @@ $campaign_prem_nord = 5; $campaign_prem_sued = 6; $campaign_gross_st_florian = 7; $campaign_kalwang = 41; +$cmapaign_st_stefan_stainz = 36; -$selected_campaign = $campaign_kalwang; +$selected_campaign = $cmapaign_st_stefan_stainz; if(!$selected_campaign) { echo "Keine Kampagne ausgewählt.\n"; diff --git a/scripts/preorder/update-preorder-add-unit.php b/scripts/preorder/update-preorder-add-unit.php index e5fe82b0a..4fc1edfde 100755 --- a/scripts/preorder/update-preorder-add-unit.php +++ b/scripts/preorder/update-preorder-add-unit.php @@ -21,8 +21,9 @@ $campaign_prem_nord = 5; $campaign_prem_sued = 6; $campaign_gross_st_florian = 7; $campaign_kalwang = 41; +$cmapaign_st_stefan_stainz = 36; -$selected_campaign = $campaign_kalwang; +$selected_campaign = $cmapaign_st_stefan_stainz; if(!$selected_campaign) { echo "Keine Kampagne ausgewählt.\n"; @@ -60,8 +61,9 @@ foreach(PreorderModel::search(['preordercampaign_id' => $selected_campaign, 'adb } - if($unit_count > 1 && $unit_count <= 4) { - // assume its single-dwelling with erroneously high door count + if($unit_count > 1) { + // legacy comment: assume its single-dwelling with erroneously high door count + // current comment: Just use any unit $unit_candidates = []; foreach($wohneinheiten as $unit) { @@ -71,14 +73,13 @@ foreach(PreorderModel::search(['preordercampaign_id' => $selected_campaign, 'adb } } - /*if(!count($unit_candidates)) { + // no candidates with door number -> use any + + if(!count($unit_candidates)) { foreach($wohneinheiten as $unit) { - if(!$unit->zusatz) continue; - if(preg_match('/Top\s+\d+/i',$unit->zusatz)) { - $unit_candidates[$unit->zusatz] = $unit; - } + $unit_candidates[] = $unit; } - }*/ + } if(count($unit_candidates)) { ksort($unit_candidates, SORT_NUMERIC);