Household members editor: leave household when repositionning to same

household, not sharing household
This commit is contained in:
2022-03-30 11:53:06 +02:00
parent de4f65fede
commit df24d085ca
2 changed files with 47 additions and 0 deletions

View File

@@ -98,6 +98,12 @@ class MembersEditor
$participation->setEndDate($membership->getStartDate());
}
}
} else {
// if a members is moved to the same household than the one he belongs to,
// we should make it leave the household
if ($person->getCurrentHousehold($date) === $this->household) {
$this->leaveMovement($date, $person);
}
}
$this->membershipsAffected[] = $membership;