Fixed setting wohneinheiten to 242 when saving

This commit is contained in:
Frank Schubert
2025-10-02 13:49:43 +02:00
parent 7ceabc3a5f
commit 334ce9f5d1

View File

@@ -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);