Commit 86a85c98 by Yvon

ceiling : remove minux in flash display, display profil incomplet instead of…

ceiling : remove minux in flash display, display profil incomplet instead of xx<=0, add confirm box before ceiling
parent 261e7f4f
......@@ -47,7 +47,7 @@ class AdherentAdminController extends CRUDController
$this->addFlash(
'sonata_flash_success',
'Prélèvement de ' . $amountDiff . ' MonA' . ' effectué.'
'Prélèvement de ' . -$amountDiff . ' MonA' . ' effectué.'
);
return new RedirectResponse(
......
{% set balance = object.user.adherent.emlcAccount.balance %}
{% set ceiling = object.user.adherent.ceiling %}
{% if balance and ceiling and balance > ceiling %}
<a class="btn btn-sm btn-default" href="{{ admin.generateObjectUrl('withdrawDownToTheCeiling', object) }}">
{% set diff = balance - ceiling %}
{% set warnMsg =
'Vous vous apprêtez à prélever ' ~ diff|number_format ~ ' MonA sur le compte de '
~ object.user.adherent ~ ' afin de ramener le solde de son compte au niveau de son plafond autorisé. Poursuivre ?'
%}
<a class="btn btn-sm btn-default"
href="{{ admin.generateObjectUrl('withdrawDownToTheCeiling', object) }}"
onclick="return confirm('{{ warnMsg }}')">
Prélever
</a>
{% endif %}
......@@ -3,7 +3,10 @@
{%- spaceless %}
{% set balance = object.user.adherent.emlcAccount.balance %}
{% set ceiling = object.user.adherent.ceiling %}
{% if balance and ceiling and balance > ceiling %}
{% if not ceiling %}
{% set class = 'label label-warning' %}
{% set text = 'profil incomplet' %}
{% elseif balance > ceiling %}
{% set class = 'label label-danger' %}
{% set text = balance ~ ' > ' ~ ceiling %}
{% else %}
......
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