New Preorderstatus handling at import

This commit is contained in:
Frank Schubert
2024-07-24 20:38:15 +02:00
parent 6bca4269da
commit 6084370efc
6 changed files with 189 additions and 54 deletions

View File

@@ -3,7 +3,27 @@
class RimoWorkorder extends mfBaseModel {
private $adb_wohneinheit;
private $termination;
public function afterSave() {
// prevent potential infinite loop
$nesting_level = mfValuecache::singleton()->get("rimoworkorder-save-nesting-level-".$this->id);
if(!$nesting_level) {
$nesting_level = 1;
} else {
$nesting_level++;
}
mfValuecache::singleton()->set("rimoworkorder-save-nesting-level-".$this->id, $nesting_level);
if($nesting_level > 1) {
return true;
}
// Statuschange from Rimo statuschange for all units
$wohneinheit = $this->getProperty("adb_wohneinheit");
if($wohneinheit) {
AddressDB::handleRimoStatusUpdate($wohneinheit->id);
}
}
public function getProperty($name) {
if($this->$name == null) {