2020-04-22 01:26:45 +00:00
|
|
|
{% extends "base.html" %}
|
2020-08-25 16:10:21 +00:00
|
|
|
{% comment %}
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
{% endcomment %}
|
|
|
|
{% load i18n pretty_money perms %}
|
2020-04-22 01:26:45 +00:00
|
|
|
|
|
|
|
{% block content %}
|
2020-08-25 16:10:21 +00:00
|
|
|
<div class="card bg-light">
|
|
|
|
<div class="card-header text-center">
|
|
|
|
<h4>{% trans "Credit from the Société générale" %}</h4>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<dl class="row">
|
2020-10-08 08:36:23 +00:00
|
|
|
<dt class="col-xl-6 text-right">{% trans 'last name'|capfirst %}</dt>
|
|
|
|
<dd class="col-xl-6">{{ object.user.last_name }}</dd>
|
|
|
|
|
|
|
|
<dt class="col-xl-6 text-right">{% trans 'first name'|capfirst %}</dt>
|
|
|
|
<dd class="col-xl-6">{{ object.user.first_name }}</dd>
|
|
|
|
|
|
|
|
<dt class="col-xl-6 text-right">{% trans 'username'|capfirst %}</dt>
|
|
|
|
<dd class="col-xl-6"><a href="{% url 'member:user_detail' pk=object.user.pk %}">{{ object.user.username }}</a></dd>
|
2020-04-22 01:26:45 +00:00
|
|
|
|
2020-08-25 16:10:21 +00:00
|
|
|
{% if "note.view_note_balance"|has_perm:object.user.note %}
|
|
|
|
<dt class="col-xl-6 text-right">{% trans 'balance'|capfirst %}</dt>
|
|
|
|
<dd class="col-xl-6">{{ object.user.note.balance|pretty_money }}</dd>
|
|
|
|
{% endif %}
|
2020-04-22 01:57:19 +00:00
|
|
|
|
2020-08-25 16:10:21 +00:00
|
|
|
<dt class="col-xl-6 text-right">{% trans 'transactions'|capfirst %}</dt>
|
|
|
|
<dd class="col-xl-6">
|
|
|
|
{% for transaction in object.transactions.all %}
|
|
|
|
{{ transaction.membership.club }} ({{ transaction.amount|pretty_money }})<br>
|
|
|
|
{% endfor %}
|
|
|
|
</dd>
|
2020-04-22 01:26:45 +00:00
|
|
|
|
2020-08-25 16:10:21 +00:00
|
|
|
<dt class="col-xl-6 text-right">{% trans 'total amount'|capfirst %}</dt>
|
|
|
|
<dd class="col-xl-6">{{ object.amount|pretty_money }}</dd>
|
|
|
|
</dl>
|
|
|
|
</div>
|
2020-04-22 01:26:45 +00:00
|
|
|
|
2020-08-25 16:10:21 +00:00
|
|
|
<div class="alert alert-warning">
|
|
|
|
{% trans 'Warning: Validating this credit implies that all membership transactions will be validated.' %}
|
|
|
|
{% trans 'If you delete this credit, there all membership transactions will be also validated, but no credit will be operated.' %}
|
|
|
|
{% trans "If this credit is validated, then the user won't be able to ask for a credit from the Société générale." %}
|
|
|
|
{% trans 'If you think there is an error, please contact the "respos info".' %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-footer text-center" id="buttons_footer">
|
|
|
|
{% if object.valid %}
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
{% trans "This credit is already validated." %}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
{% if object.user.note.balance < object.amount %}
|
2020-04-22 01:26:45 +00:00
|
|
|
<div class="alert alert-warning">
|
2020-08-25 16:10:21 +00:00
|
|
|
{% trans "Warning: if you don't validate this credit, the note of the user doesn't have enough money to pay its memberships." %}
|
|
|
|
{% trans "Please ask the user to credit its note before deleting this credit." %}
|
2020-04-22 01:26:45 +00:00
|
|
|
</div>
|
2020-08-25 16:10:21 +00:00
|
|
|
{% endif %}
|
2020-04-22 01:26:45 +00:00
|
|
|
|
2020-08-25 16:10:21 +00:00
|
|
|
<form method="post">
|
|
|
|
{% csrf_token %}
|
|
|
|
<div class="btn-group btn-block">
|
|
|
|
<button name="validate" class="btn btn-success">{% trans "Validate" %}</button>
|
|
|
|
{% if object.user.note.balance >= object.amount %}
|
|
|
|
<button name="delete" class="btn btn-danger">{% trans "Delete" %}</button>
|
2020-04-22 01:57:19 +00:00
|
|
|
{% endif %}
|
2020-08-25 16:10:21 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
<a href="{% url 'treasury:soge_credits' %}"><button
|
|
|
|
class="btn btn-primary btn-block">{% trans "Return to credit list" %}</button></a>
|
2020-04-22 01:26:45 +00:00
|
|
|
</div>
|
2020-08-25 16:10:21 +00:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|