Commit 13a8e0c6 by Yvon Kerdoncuff

Merge branch '6493-adherent-display-recurring-payment-info' into 'develop'

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

See merge request cooperatic/kohinos-tav!112
parents 590ce97d 69b27ff2
......@@ -105,6 +105,7 @@ class AppExtension extends AbstractExtension
new \Twig_SimpleFunction('getDonType', [$this, 'getDonType']),
new \Twig_SimpleFunction('getLastTavCotisationForAdherent', [$this, 'getLastTavCotisationForAdherent']),
new \Twig_SimpleFunction('getPrestaLastTransactionsExportDate', [$this, 'getPrestaLastTransactionsExportDate']),
new \Twig_SimpleFunction('checkExistingRecurringPayment', [$this, 'checkExistingRecurringPayment']),
new \Twig_SimpleFunction('parameter', function ($name) {
return $this->container->getParameter($name);
}),
......@@ -563,4 +564,16 @@ class AppExtension extends AbstractExtension
return $res;
}
/**
* [checkExistingRecurringPayment].
*
* @param String $userEmail
*
* @return String
*/
public function checkExistingRecurringPayment($userEmail)
{
return $this->tavCotisationUtils->checkExistingRecurringPayment($userEmail);
}
}
......@@ -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
*/
......
......@@ -21,7 +21,13 @@
{% include '@kohinos/adherent/block/solidoume.html.twig' %}
{% endif %}
{% 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/block/operations.html.twig' %}
{% 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