Merge branch 'fronkdev' into 'master'
added importing service active state (preorder 500) in rimo import See merge request fronk/thetool!645
This commit is contained in:
@@ -478,6 +478,23 @@ foreach ($clusters as $cluster_data) {
|
||||
if (is_object($serviceResponse) && property_exists($serviceResponse, "item") && is_array($serviceResponse->item) && count($serviceResponse->item)) {
|
||||
foreach ($serviceResponse->item as $service) {
|
||||
if ($service->masterItem->name != "FTTx Service (red)") continue;
|
||||
|
||||
// get service state
|
||||
if(property_exists($service, "customerState") && is_object($service->customerState) && property_exists($service->customerState, "userLabel") && strtolower($service->customerState->userLabel) == "active") {
|
||||
// active => order 500
|
||||
$preorder = \PreorderModel::getFirst(["adb_wohneinheit_id" => $unit->id]);
|
||||
if($preorder) {
|
||||
$new_status = \PreorderstatusModel::getFirst(["code" => 500]);
|
||||
if($new_status) {
|
||||
if($preorder->status->code < $new_status->code) {
|
||||
$preorder->status_id = $new_status->id;
|
||||
$preorder->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update patch position
|
||||
if (!is_object($service->portA) || !$service->portA) continue;
|
||||
|
||||
$fixedDN = $service->portA->fixEndDN;
|
||||
|
||||
Reference in New Issue
Block a user