diff --git a/application/AddressDB/AddressDB.php b/application/AddressDB/AddressDB.php index 3c5856bd7..39db020c9 100644 --- a/application/AddressDB/AddressDB.php +++ b/application/AddressDB/AddressDB.php @@ -130,9 +130,13 @@ class AddressDB { } + $netowner = $hausnummer->getNetowner(); + if(!$netowner || !$netowner->id) { + $log->debug(__METHOD__.": Unable to determine netowner for Hausnummer ".$hausnummer->id); + return true; + } - - $status_matrix = array_reverse(TT_PREORDER_RIMO_STATUS_MATRIX); + $status_matrix = array_reverse(TT_PREORDER_RIMO_STATUS_MATRIX[$netowner->id]); $log->debug(__METHOD__.": b_ex_state: ".$b_ex_state); $log->debug(__METHOD__.": b_op_state: ".$b_op_state); @@ -218,7 +222,6 @@ class AddressDB { if($hausnummer->status_id != $old_status) { $hausnummer->save(); } - } //$wohneinheit = new ADBWohneinheit($wohneinheit->id); @@ -234,9 +237,18 @@ class AddressDB { } + if(array_key_exists("hf", $matrix)) { + $hausnummer_flag = $matrix["hf"]; + if($hausnummer_flag) { + $log->debug(__METHOD__.": new Hausnummer (".$wohneinheit->id.") statusflag: ".$matrix["hf"]); + $hausnummer->setStatusflag($hausnummer_flag, 1); + } + } - break; + + // commented, for 140/141 + //break; } return true; }