Fixed marking units with rimo_deleted
This commit is contained in:
@@ -1018,7 +1018,7 @@ function getServiceDnValues($dn)
|
||||
function deleteHomesIfEligible(Array $rimo_home_list, Object $hausnummer) {
|
||||
$return_strings = [];
|
||||
foreach (\ADBWohneinheitModel::search(["hausnummer_id" => $hausnummer->id]) as $adb_unit) {
|
||||
$adb_unit->rimo_deleted = 1;
|
||||
//$adb_unit->rimo_deleted = 1;
|
||||
/*if(!$adb_unit->extref) {
|
||||
$adb_unit->save(["no_updates" => 1]);
|
||||
continue;
|
||||
@@ -1031,6 +1031,7 @@ function deleteHomesIfEligible(Array $rimo_home_list, Object $hausnummer) {
|
||||
$oaid_units_count = \ADBWohneinheitModel::count(["oaid" => $adb_unit->oaid]);
|
||||
if($oaid && $oaid->origin == "ofaa" && $oaid_units_count === 1) {
|
||||
// last unit with this OAID
|
||||
$adb_unit->rimo_deleted = 1;
|
||||
$adb_unit->save(["no_updates" => 1]);
|
||||
continue;
|
||||
}
|
||||
@@ -1039,6 +1040,7 @@ function deleteHomesIfEligible(Array $rimo_home_list, Object $hausnummer) {
|
||||
|
||||
if(count($adb_unit->active_preorders)) {
|
||||
// don't delete if there is an active order
|
||||
$adb_unit->rimo_deleted = 1;
|
||||
$adb_unit->save(["no_updates" => 1]);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user