Commit a405983c authored by Yoann PIETRI's avatar Yoann PIETRI Committed by root

Users can pay their own cotisation with their solde.

parent 7ae8908c
......@@ -51,6 +51,7 @@ class EditOptionalUserForm(ModelForm):
self.fields['max_solde'].label = 'Solde maximum'
self.fields['min_online_payment'].label = 'Montant de rechargement minimum en ligne'
self.fields['self_adhesion'].label = 'Auto inscription'
self.fields['max_recharge'].label = 'Rechargement max'
class EditOptionalMachineForm(ModelForm):
......
......@@ -52,6 +52,10 @@ class OptionalUser(models.Model):
max_digits=5,
decimal_places=2,
default=10
max_recharge = models.DecimalField(
max_digits=5,
decimal_places=2,
default=100
)
gpg_fingerprint = models.BooleanField(default=True)
all_can_create = models.BooleanField(
......
......@@ -56,6 +56,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ useroptions.all_can_create }}</td>
<th>Auto inscription</th>
<td>{{ useroptions.self_adhesion }}</td>
{% if useroptions.user_solde %}
<th>Rechargement max</th>
<td>{{ useroptions.max_recharge }}</td>
{% endif %}
</tr>
{% if useroptions.user_solde %}
<tr>
......
......@@ -196,7 +196,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<p>Aucune machine</p>
{% endif %}
<h2>Cotisations</h2>
<h4>{% can_create Facture %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Ajouter une cotisation</a> {% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Modifier le solde</a>{% endif%}{% acl_else %}{% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new_facture_solde' user.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Ajouter une cotisation par solde</a>{% endif %}{% acl_end %}</h4>
<h4>{% can_create Facture %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Ajouter une cotisation</a> {% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Modifier le solde</a>{% endif%}{% acl_else %}{% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new_facture_solde' user.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Ajouter une cotisation par solde</a>{% endif }{% acl_end %}</h4>
{% if facture_list %}
{% include "cotisations/aff_cotisations.html" with facture_list=facture_list %}
{% 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