Commit fa204e43 by Damien Moulard

adherent pay its cotisation: use right amount for household based allowance

parent e26663ec
......@@ -36,11 +36,22 @@ class AchatMonnaieFormType extends FluxFormType
if ($this->container->getParameter('tav_env')) {
$montant = 0;
$profilDeCotisation = $this->security->getUser()->getAdherent()->getProfilDeCotisation();
if (null != $profilDeCotisation) {
$montant = $profilDeCotisation->getMontant();
if ($this->container->getParameter('household_based_allowance')) {
$cosisationMontant = $this->security->getUser()->getAdherent()->getCotisationAmount();
if (null != $cosisationMontant) {
$montant = $cosisationMontant;
} else {
$montant = false;
}
} else {
$montant = false;
$profilDeCotisation = $this->security->getUser()->getAdherent()->getProfilDeCotisation();
if (null != $profilDeCotisation) {
$montant = $profilDeCotisation->getMontant();
} else {
$montant = false;
}
}
$builder
......
......@@ -6,9 +6,12 @@
{% block blockcontent %}
{% set form = getPayerCotisationTAVForm(app.user) %}
{% if form.montant.vars.value == false %}
{% if form.montant.vars.value == false and not household_based_allowance %}
<p>{{ 'Vous n\'avez pas de profil de cotisation associé, vous ne pouvez donc pas payer de cotisation.'|trans }}</p>
<p>{{ 'Veuillez contacter un administrateur.'|trans }}</p>
<p>{{ 'Veuillez contacter un•e administrateur•rice.'|trans }}</p>
{% elseif form.montant.vars.value == false and household_based_allowance %}
<p>{{ 'Vous n\'avez pas de montant de cotisation renseigné dans votre profil, vous ne pouvez donc pas payer de cotisation.'|trans }}</p>
<p>{{ 'Veuillez contacter un•e administrateur•rice.'|trans }}</p>
{% else %}
<p>
{{ 'Montant de la cotisation à payer'|trans }} : <span class="paiement_cotisation_montant">{{ form.montant.vars.value }}</span>
......
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