Counting EFH/MPH from Hausnummer now in Prordercampaign/Index
This commit is contained in:
@@ -44,6 +44,22 @@ class ADBHausnummer extends mfBaseModel {
|
||||
|
||||
}
|
||||
|
||||
public function getBuildingType() {
|
||||
$rimo_type = strtolower($this->rimo_type);
|
||||
|
||||
if(array_key_exists($this->rimo_type, TT_ADB_GDA_TYPES)) {
|
||||
return TT_ADB_GDA_TYPES[$this->rimo_type];
|
||||
}
|
||||
|
||||
$gdaeigenschaft = strtolower($this->gdaeigenschaft);
|
||||
if(array_key_exists($gdaeigenschaft, TT_ADB_GDA_TYPES)) {
|
||||
return TT_ADB_GDA_TYPES[$gdaeigenschaft];
|
||||
}
|
||||
|
||||
return "sd";
|
||||
|
||||
}
|
||||
|
||||
public function setNewStatusCode($new_status_code) {
|
||||
if(!$new_status_code) return false;
|
||||
|
||||
|
||||
@@ -174,15 +174,13 @@ class Preordercampaign extends mfBaseModel {
|
||||
$count_sd = 0;
|
||||
$count_md = 0;
|
||||
foreach($this->getProperty("active_preorders") as $preorder) {
|
||||
//echo "/c:".$preorder->connection_count."/";
|
||||
if($preorder->connection_type == "single-dwelling") {
|
||||
$bt = $preorder->adb_hausnummer->getBuildingType();
|
||||
if($bt == "sd") {
|
||||
$count_sd += $preorder->connection_count ? (int)$preorder->connection_count : 1;
|
||||
} elseif ($preorder->connection_type == "multi-dwelling") {
|
||||
} elseif ($bt == "md") {
|
||||
$count_md += $preorder->connection_count ? (int)$preorder->connection_count : 1;
|
||||
}
|
||||
$count += (int)$preorder->connection_count;
|
||||
|
||||
//echo "/s:$count/";
|
||||
}
|
||||
$this->active_preorder_count = $count;
|
||||
$this->active_preorder_count_sd = $count_sd;
|
||||
|
||||
Reference in New Issue
Block a user