Rimo Import update

This commit is contained in:
Frank Schubert
2025-05-16 00:08:14 +02:00
parent a1509073e4
commit a3822abfad
5 changed files with 22 additions and 3 deletions

View File

@@ -64,6 +64,12 @@
<?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>
<th>Status</th>

View File

@@ -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 [];

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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";