Commit cf535c67 by Julien Jorry

Fix cotisation en emlc

parent 7cb44111
...@@ -58,7 +58,7 @@ class UserController extends AbstractController ...@@ -58,7 +58,7 @@ class UserController extends AbstractController
if ($form->isSubmitted()) { if ($form->isSubmitted()) {
$cotisation = $form->getData(); $cotisation = $form->getData();
if ($form->isValid()) { if ($form->isValid()) {
if (MoyenEnum::MOYEN_MLC == $cotisation->getMoyen()) { if (MoyenEnum::MOYEN_EMLC == $cotisation->getMoyen()) {
try { try {
$cotisation->setRecu(true); $cotisation->setRecu(true);
$this->operationUtils->executeOperations($cotisation); $this->operationUtils->executeOperations($cotisation);
......
...@@ -41,6 +41,7 @@ class UserPrestataireController extends FluxController ...@@ -41,6 +41,7 @@ class UserPrestataireController extends FluxController
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$errorText = '';
foreach ($originalAdresses as $adresse) { foreach ($originalAdresses as $adresse) {
if (false === $presta->getGeolocs()->contains($adresse)) { if (false === $presta->getGeolocs()->contains($adresse)) {
$adresse->getPrestataires()->removeElement($presta); $adresse->getPrestataires()->removeElement($presta);
...@@ -59,7 +60,6 @@ class UserPrestataireController extends FluxController ...@@ -59,7 +60,6 @@ class UserPrestataireController extends FluxController
$emailConstraint $emailConstraint
); );
} }
$errorText = '';
foreach ($errors as $error) { foreach ($errors as $error) {
if ($error->count()) { if ($error->count()) {
$errorText .= $error[0]->getMessage(); $errorText .= $error[0]->getMessage();
......
...@@ -26,16 +26,20 @@ ...@@ -26,16 +26,20 @@
{% endif %} {% endif %}
</ul> </ul>
{% if ((app.user and is_granted('ROLE_ADHERENT') and app.user.adherent) or (app.user and is_granted('ROLE_PRESTATAIRE') and app.session.has('_prestagere'))) %} {% set cotisEnd = false %}
{% if false != isCotisationValid(app.user) %} {% if (app.user and is_granted('ROLE_ADHERENT') and app.user.adherent) %}
<span class='btn btn-secondary disabled mt-2' disabled='disabled'> {% set cotisEnd = isCotisationValidForAdherent(app.user.adherent) %}
{{ 'Votre cotisation est à jour'|trans }} {% elseif (app.user and is_granted('ROLE_PRESTATAIRE') and app.session.has('_prestagere')) %}
</span> {% set cotisEnd = isCotisationValidForPresta(app.session.get('_prestagere')) %}
{% else %} {% endif %}
<a class='btn btn-xs btn-primary mt-2' href='{{ path('cotiser') }}'> {% if false != cotisEnd %}
{{ 'Cotiser'|trans }} <span class='btn btn-secondary disabled mt-2' disabled='disabled'>
</a> {{ 'Votre cotisation est à jour'|trans }}
{% endif %} </span>
{% else %}
<a class='btn btn-xs btn-primary mt-2' href='{{ path('cotiser') }}'>
{{ 'Cotiser'|trans }}
</a>
{% endif %} {% endif %}
{% endblock blockcontent %} {% endblock blockcontent %}
{% endif %} {% endif %}
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