From 334ce9f5d153c7fd28088208c77ee3b3a64a97ca Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Thu, 2 Oct 2025 13:49:43 +0200 Subject: [PATCH] Fixed setting wohneinheiten to 242 when saving --- application/Preorder/Preorder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);