Commit 69b27ff2 by Damien Moulard

adherent: display recurring payment info in home if exist, if so dont display…

adherent: display recurring payment info in home if exist, if so dont display cotisation payment form
parent 2357feb2
...@@ -105,6 +105,7 @@ class AppExtension extends AbstractExtension ...@@ -105,6 +105,7 @@ class AppExtension extends AbstractExtension
new \Twig_SimpleFunction('getDonType', [$this, 'getDonType']), new \Twig_SimpleFunction('getDonType', [$this, 'getDonType']),
new \Twig_SimpleFunction('getLastTavCotisationForAdherent', [$this, 'getLastTavCotisationForAdherent']), new \Twig_SimpleFunction('getLastTavCotisationForAdherent', [$this, 'getLastTavCotisationForAdherent']),
new \Twig_SimpleFunction('getPrestaLastTransactionsExportDate', [$this, 'getPrestaLastTransactionsExportDate']), new \Twig_SimpleFunction('getPrestaLastTransactionsExportDate', [$this, 'getPrestaLastTransactionsExportDate']),
new \Twig_SimpleFunction('checkExistingRecurringPayment', [$this, 'checkExistingRecurringPayment']),
new \Twig_SimpleFunction('parameter', function ($name) { new \Twig_SimpleFunction('parameter', function ($name) {
return $this->container->getParameter($name); return $this->container->getParameter($name);
}), }),
...@@ -563,4 +564,16 @@ class AppExtension extends AbstractExtension ...@@ -563,4 +564,16 @@ class AppExtension extends AbstractExtension
return $res; return $res;
} }
/**
* [checkExistingRecurringPayment].
*
* @param String $userEmail
*
* @return String
*/
public function checkExistingRecurringPayment($userEmail)
{
return $this->tavCotisationUtils->checkExistingRecurringPayment($userEmail);
}
} }
...@@ -50,7 +50,7 @@ class TAVCotisationUtils ...@@ -50,7 +50,7 @@ class TAVCotisationUtils
} }
/** /**
* Returns a descriptive string of existong payment, or empty string * Returns a descriptive string of existing payment, or empty string.
* *
* @param String $userEmail * @param String $userEmail
*/ */
......
...@@ -21,7 +21,13 @@ ...@@ -21,7 +21,13 @@
{% include '@kohinos/adherent/block/solidoume.html.twig' %} {% include '@kohinos/adherent/block/solidoume.html.twig' %}
{% endif %} {% endif %}
{% else %} {% else %}
{% include '@kohinos/tav/block/adherent_payer_cotisation.html.twig' %} {% set existingRecurringPayment = checkExistingRecurringPayment(app.user.email) %}
{% if existingRecurringPayment != "" %}
{% include '@kohinos/tav/block/ongoing_recurring_payment.html.twig' with {'existingPaymentDescription': existingRecurringPayment} %}
{% else %}
{% include '@kohinos/tav/block/adherent_payer_cotisation.html.twig' %}
{% endif %}
{% include '@kohinos/tav/block/adherent_payment_code.html.twig' %} {% include '@kohinos/tav/block/adherent_payment_code.html.twig' %}
{% include '@kohinos/block/operations.html.twig' %} {% include '@kohinos/block/operations.html.twig' %}
{% endif %} {% endif %}
{% set existingPaymentDescription = existingPaymentDescription|default('') %}
<div class="card mb-3 blocksolde">
<div class="card-body p-2">
<br/>
<p>{{existingPaymentDescription}}</p>
<p class="form-text text-muted">
Pour demander une interruption anticipée, merci de contacter la caisse à l'adresse {{ KOH_MLC_CONTACT_EMAIL }} au minimum dix jours avant la prochaine échéance.
</p>
</div>
</div>
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