Rimo Import update
This commit is contained in:
@@ -63,6 +63,12 @@
|
||||
<a href="https://maps.google.com/maps?t=k&q=loc:<?=$address->gps_lat?>+<?=$address->gps_long?>" target="_blank"><i class="fas fa-fw fa-globe"></i> <?=$address->gps_lat?>, <?=$address->gps_long?></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Rimo Execution State</th>
|
||||
<td><?=$address->rimo_ex_state?></td>
|
||||
</tr><tr>
|
||||
<th>Rimo Operational State</th>
|
||||
<td><?=$address->rimo_op_state?></td>
|
||||
</tr><tr>
|
||||
<td colspan="2"><h4>Status</h4></td>
|
||||
</tr><tr>
|
||||
|
||||
@@ -308,6 +308,8 @@ class ADBWohneinheit extends mfBaseModel {
|
||||
}
|
||||
|
||||
if($name == "rimo_workorders") {
|
||||
if(!$this->id) return null;
|
||||
|
||||
$rimo_workorders = RimoWorkorderModel::search(["adb_wohneinheit_id" => $this->id]);
|
||||
if(count($rimo_workorders)) {
|
||||
$this->rimo_workorders = $rimo_workorders;
|
||||
@@ -316,6 +318,7 @@ class ADBWohneinheit extends mfBaseModel {
|
||||
}
|
||||
|
||||
if($name == "preorders") {
|
||||
if(!$this->id) return [];
|
||||
$preorders = PreorderModel::search(["adb_wohneinheit_id" => $this->id]);
|
||||
if(!count($preorders)) {
|
||||
return [];
|
||||
@@ -325,6 +328,7 @@ class ADBWohneinheit extends mfBaseModel {
|
||||
}
|
||||
|
||||
if($name == "active_preorders") {
|
||||
if(!$this->id) return [];
|
||||
$preorders = PreorderModel::searchActive(["adb_wohneinheit_id" => $this->id]);
|
||||
if(!count($preorders)) {
|
||||
return [];
|
||||
|
||||
@@ -237,6 +237,11 @@ class AddressHelper
|
||||
$force_no_subcd = true;
|
||||
}
|
||||
}
|
||||
|
||||
if($hausnummer && $hausnummer->rimo_id) {
|
||||
$hausnummer = null;
|
||||
}
|
||||
|
||||
/*if(!$hausnummer) {
|
||||
//echo "Hausnummer adrcd $adrcd not found\n";
|
||||
} else {
|
||||
@@ -254,6 +259,10 @@ class AddressHelper
|
||||
if($hausnummer && $adrcd && $hausnummer->adrcd != $adrcd) {
|
||||
$hausnummer = null;
|
||||
}
|
||||
|
||||
if($hausnummer && $hausnummer->rimo_id) {
|
||||
$hausnummer = null;
|
||||
}
|
||||
//}
|
||||
if (!$hausnummer) {
|
||||
// dont create Hausnummer if Canceled in Rimo
|
||||
|
||||
@@ -893,9 +893,9 @@ function getServiceDnValues($dn)
|
||||
}
|
||||
}
|
||||
|
||||
if(!array_key_exists("Shelf", $fields) && array_key_exists("SpliceBox", $fields)) {
|
||||
/*if(!array_key_exists("Shelf", $fields) && array_key_exists("SpliceBox", $fields)) {
|
||||
$fields['Shelf'] = $fields['SpliceBox'];
|
||||
}
|
||||
}*/
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ while($hausnummer_data = $db->fetch_object($res)) {
|
||||
if(ADBWohneinheitModel::count(["oaid" => $del_unit->oaid]) == 1) {
|
||||
//echo "!! Hausnummer ".$hausnummer->id.": cannot delete unit ".$del_unit->id." because it's the last Unit with OAID ".$oaid->oaid."\n";
|
||||
$ftu_id = $del_unit->ftu_data["id"];
|
||||
RimoApi::unassignOaid($oaid->oaid, $ftu_id);
|
||||
Rimoapi::unassignOaid($oaid->oaid, $ftu_id);
|
||||
|
||||
echo "Deleting OAID ".$oaid->oaid." from FTU ".$ftu_id."\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user