Commit 5574b117 by Damien Moulard

prevent having null mlcAllowanceAmount in applyHouseholdAllowance

parent c982bae0
...@@ -708,6 +708,7 @@ class AdherentAdmin extends AbstractAdmin ...@@ -708,6 +708,7 @@ class AdherentAdmin extends AbstractAdmin
{ {
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager(); $em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
// @TODO: Received UndefinedMethodError: "Attempted to call an undefined method named "getUser" of class "App\Entity\User".
if (empty($adherent->getUser()->getUsername())) { if (empty($adherent->getUser()->getUsername())) {
$adherent->getUser()->setUsername($adherent->getUser()->getEmail()); $adherent->getUser()->setUsername($adherent->getUser()->getEmail());
} }
......
...@@ -314,6 +314,8 @@ class TAVCotisationUtils ...@@ -314,6 +314,8 @@ class TAVCotisationUtils
$householdCount = $adherent->getHouseholdCount(); $householdCount = $adherent->getHouseholdCount();
if (is_null($householdCount) || $householdCount == 0) { if (is_null($householdCount) || $householdCount == 0) {
// if required param is missing, set allocation to a default value of 100 to avoid process interuption
$adherent->setAllocationAmount(100);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment