Rimo Status also update sets status when input params higher then
specified
This commit is contained in:
@@ -105,14 +105,28 @@ class AddressDB {
|
||||
|
||||
$order_type = $preorder->type;
|
||||
|
||||
foreach(TT_PREORDER_RIMO_STATUS_MATRIX as $matrix) {
|
||||
//echo "wohneinheit ".$wohneinheit->id."\n";
|
||||
//var_dump($matrix);
|
||||
if($matrix["rbop"] && $matrix["rbop"] != $b_op_state) continue;
|
||||
if($matrix["rbex"] && $matrix["rbex"] != $b_ex_state) continue;
|
||||
$status_matrix = array_reverse(TT_PREORDER_RIMO_STATUS_MATRIX);
|
||||
|
||||
if($matrix["rhop"] && $matrix["rhop"] != $h_op_state) continue;
|
||||
if($matrix["rhex"] && $matrix["rhex"] != $h_ex_state) continue;
|
||||
|
||||
foreach($status_matrix as $matrix) {
|
||||
//var_dump($matrix);
|
||||
if($matrix["rbop"]) {
|
||||
if(!is_array($matrix["rbop"])) $matrix["rbop"] = [$matrix["rbop"]];
|
||||
if(!in_array($b_op_state, $matrix["rbop"])) continue;
|
||||
}
|
||||
if($matrix["rbex"] && $matrix["rbex"] != $b_ex_state) {
|
||||
if(!is_array($matrix["rbex"])) $matrix["rbex"] = [$matrix["rbex"]];
|
||||
if(!in_array($b_ex_state, $matrix["rbex"])) continue;
|
||||
};
|
||||
|
||||
if($matrix["rhop"] && $matrix["rhop"] != $h_op_state) {
|
||||
if(!is_array($matrix["rhop"])) $matrix["rhop"] = [$matrix["rhop"]];
|
||||
if(!in_array($h_op_state, $matrix["rhop"])) continue;
|
||||
};
|
||||
if($matrix["rhex"] && $matrix["rhex"] != $h_ex_state) {
|
||||
if(!is_array($matrix["rhex"])) $matrix["rhex"] = [$matrix["rhex"]];
|
||||
if(!in_array($h_ex_state, $matrix["rhex"])) continue;
|
||||
};
|
||||
|
||||
if($matrix["rwo"] && (!$workorder || $matrix["rwo"] != $wo_state)) continue;
|
||||
|
||||
@@ -132,17 +146,28 @@ class AddressDB {
|
||||
$hausnummer_status = $matrix["h"];
|
||||
if($hausnummer_status) {
|
||||
$log->debug(__METHOD__.": new Hausnummer (".$hausnummer->id.") status: ".$matrix["h"]);
|
||||
$old_status = $hausnummer->status_id;
|
||||
$hausnummer->setNewStatusCode($hausnummer_status);
|
||||
$hausnummer->save();
|
||||
if($hausnummer->status_id != $old_status) {
|
||||
$hausnummer->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$wohneinheit = new ADBWohneinheit($wohneinheit->id);
|
||||
|
||||
$wohneinheit_status = $matrix["w"];
|
||||
if($wohneinheit_status) {
|
||||
$log->debug(__METHOD__.": new Wohneinheit (".$wohneinheit->id.") status: ".$matrix["w"]);
|
||||
$old_status_id = $wohneinheit->status_id;
|
||||
$wohneinheit->setNewStatusCode($wohneinheit_status);
|
||||
$wohneinheit->save();
|
||||
if($wohneinheit->status_id != $old_status_id) {
|
||||
$wohneinheit->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user