diff --git a/application/Preorder/Preorder.php b/application/Preorder/Preorder.php index 3e3f9fb98..51d9df007 100644 --- a/application/Preorder/Preorder.php +++ b/application/Preorder/Preorder.php @@ -598,7 +598,7 @@ class Preorder extends mfBaseModel { } } - if(array_key_exists("ws", $flag_matrix_item) && $flag_matrix_item["ws"] && $this->adb_wohneinheit_id) { + if($flag->value->value && array_key_exists("ws", $flag_matrix_item) && $flag_matrix_item["ws"] && $this->adb_wohneinheit_id) { //echo "Setting Wohneinheit status to ".$flag_matrix_item["ws"]." from ".$this->getProperty("adb_wohneinheit")->status->code."\n"; // set new wohneinheit status $new_wohneinheit_status = ADBStatusModel::getFirst(["code" => $flag_matrix_item["ws"]]); @@ -610,7 +610,7 @@ class Preorder extends mfBaseModel { $wohneinheit = new ADBWohneinheit($this->adb_wohneinheit_id); if(!$wohneinheit->id) return true; - $this->log->debug("[".$this->_ruid."] ".__METHOD__ . ": new wohneinheit status code " . $new_wohneinheit_status->code); + $this->log->debug("[".$this->_ruid."] ".__METHOD__ . ": new wohneinheit status code " . $new_wohneinheit_status->code." (because flag ".$flag->code." is active)"); // only update if current status is less than new status if($wohneinheit->status->code < $new_wohneinheit_status->code) { $this->log->debug("[".$this->_ruid."] ".__METHOD__ . ": Setting new wohneinheit status code: " . $new_wohneinheit_status->code);