{% extends '@kohinos/block/onetransaction.html.twig' %}

{# DISABLE ALL TRANSACTIONS IF USER HAS NO COTISATION VALID #}
{# {% block blocktoggle %}{% if isCotisationValid(app.user) %}collapse{% endif %}{% endblock blocktoggle %} #}

{% block blocktitle %}
	<i class="fa fa-external-link fa-external-link-alt mr-4"></i> {{ 'Reconversion'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
	{% if isCotisationValid(app.user) %}
		<p>{{'Solde de votre compte'|trans}} : {{ getCurrentPrestataire().emlcAccount.balance }}<br/>
		{% if KOH_RECONVERSION_PRESTATAIRE is defined and KOH_RECONVERSION_PRESTATAIRE != '0' and KOH_RECONVERSION_PRESTATAIRE is not empty %}
			<em>{{'Taux de reconversion'|trans}} : {{ getCurrentPrestataire().tauxreconversion ? getCurrentPrestataire().tauxreconversion : KOH_RECONVERSION_PRESTATAIRE}}%</em>
		{% endif %}
		</p>
		{% set form = getReconversionForm(app.user) %}
		{{ form_start(form) }}
		    {% if form.montant is defined %}
		    	{{ form_row(form.montant, { 'label': 'Montant à reconvertir : ' }) }}
		    {% endif %}
		    {% if form.reference is defined %}
		    	{{ form_row(form.reference) }}
		    {% endif %}
		{{ form_end(form) }}
	{% else %}
		<p class='text-danger'>Votre cotisation dout être renouvelėe avant de pouvoir faire cette opération !</p>
	{% endif %}
{% endblock blockcontent %}