Fixed not setting flag 141 in rimo-import
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user