Added workorder team filter in Preorder/Index

This commit is contained in:
Frank Schubert
2024-03-22 12:33:27 +01:00
parent 95af0c65eb
commit 31d9c458d1
3 changed files with 33 additions and 13 deletions
+13 -5
View File
@@ -446,12 +446,20 @@ foreach($netowners as $apiOwner) {
$wo = \RimoWorkorderModel::getFirst(["rimo_id" => $rimo_workorder_id]);
if($wo && $workorder_status != $wo->rimo_status) {
if($wo) {
//echo "Updating Workorder $rimo_workorder_id ($workorder_home_id)\n";
$wo->rimo_status = $workorder_status;
if($team_id) $wo->rimo_team_id = $team_id;
if($team_name) $wo->rimo_team_name = $team_name;
$wo->save();
if($workorder_status != $wo->rimo_status) {
$wo->rimo_status = $workorder_status;
$wo->save();
}
if($team_id != $wo->rimo_team_id) {
$wo->rimo_team_id = $team_id;
$wo->save();
}
if($team_name != $wo->rimo_team_name) {
$wo->rimo_team_name = $team_name;
$wo->save();
}
}
if(!$wo) {