[Household] when two adresses on same date, close the existing one

This commit is contained in:
2021-11-29 21:13:28 +01:00
parent 18cfe17878
commit 217b74b9e2
2 changed files with 2 additions and 1 deletions

View File

@@ -92,7 +92,7 @@ class Household
public function addAddress(Address $address)
{
foreach ($this->getAddresses() as $a) {
if ($a->getValidFrom() < $address->getValidFrom() && $a->getValidTo() === null) {
if ($a->getValidFrom() <= $address->getValidFrom() && $a->getValidTo() === null) {
$a->setValidTo($address->getValidFrom());
}
}