diff --git a/CHANGELOG.md b/CHANGELOG.md index 89d450bcc..c90c602e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ## Unreleased +* [household] do not allow to create two addresses on the same date ## Test releases diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index 39b9c3ca3..59e9f4149 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -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()); } }