Fixed not setting flag 141 in rimo-import

This commit is contained in:
Frank Schubert
2025-08-20 16:28:12 +02:00
parent 5d4b6a6d04
commit 73cf1098a5
8 changed files with 128 additions and 80 deletions

View File

@@ -9,13 +9,16 @@ class ADBWohneinheitStatusflagValue extends mfBaseModel {
}
protected function afterSave($_params = []) {
$this->log->debug("[".$this->_ruid."] "."-----------------------------------------");
$this->log->debug("[".$this->_ruid."] ".__METHOD__.": statusflagvalue_id: ".$this->id);
if(!property_exists($this->_old_data, "value") || $this->_old_data->value != $this->data->value) {
// cascade new status to all preorders
foreach(PreorderModel::search(["adb_wohneinheit_id" => $this->wohneinheit_id]) as $preorder) {
// get PreorederStatusflag
$pflag = PreorderStatusflagModel::getFirst(["code" => $this->getProperty("flag")->code]);
if(!$pflag) {
$this->log->debug(__METHOD__ . ": Preorder statusflag " . $this->getProperty("flag")->code . " not found");
$this->log->debug("[".$this->_ruid."] ".__METHOD__ . ": Preorder statusflag " . $this->getProperty("flag")->code . " not found");
return true;
}
@@ -32,9 +35,9 @@ class ADBWohneinheitStatusflagValue extends mfBaseModel {
}
if($new || $pflagval->value != $this->value) {
$pflagval->value = $this->value;
//$this->log->debug(__METHOD__.": ".print_r($pflagval, true));
//$this->log->debug("[".$this->_ruid."] ".__METHOD__.": ".print_r($pflagval, true));
$pflagval->save();
$this->log->debug(__METHOD__ . ": statusflag " . $this->getProperty("flag")->code . " saved for preorder " . $preorder->id);
$this->log->debug("[".$this->_ruid."] ".__METHOD__ . ": statusflag " . $this->getProperty("flag")->code . " saved for preorder " . $preorder->id);
}
}
}