Commit 917b559b authored by Sli's avatar Sli

Merge branch 'historique_cotisations' into 'master'

user: add subscription history

See merge request !167
parents 9089fe3a 72a4bde6
Pipeline #1566 passed with stage
in 7 minutes and 25 seconds
......@@ -389,7 +389,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=root.pk).first(),
subscription_type=default_subscription,
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
......@@ -401,7 +401,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=skia.pk).first(),
subscription_type=default_subscription,
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
......@@ -413,7 +413,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=counter.pk).first(),
subscription_type=default_subscription,
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
......@@ -425,7 +425,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=comptable.pk).first(),
subscription_type=default_subscription,
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
......@@ -437,7 +437,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=r.pk).first(),
subscription_type=default_subscription,
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
......@@ -449,7 +449,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=subscriber.pk).first(),
subscription_type=default_subscription,
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
......@@ -461,7 +461,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=old_subscriber.pk).first(),
subscription_type=default_subscription,
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start(datetime(year=2012, month=9, day=4))
s.subscription_end = s.compute_end(
......@@ -841,7 +841,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=sli.pk).first(),
subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
......@@ -853,7 +853,7 @@ Welcome to the wiki page!
s = Subscription(
member=User.objects.filter(pk=krophil.pk).first(),
subscription_type=list(settings.SITH_SUBSCRIPTIONS.keys())[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0][0],
)
s.subscription_start = s.compute_start()
s.subscription_end = s.compute_end(
......
......@@ -119,6 +119,26 @@
<div>
{{ user_subscription(profile) }}
</div>
<br>
<div id="drop_subscriptions">
<h5>{% trans %}Subscription history{% endtrans %}</h5>
<table>
<tr>
<th>{% trans %}Subscription start{% endtrans %}</th>
<th>{% trans %}Subscription end{% endtrans %}</th>
<th>{% trans %}Subscription type{% endtrans %}</th>
<th>{% trans %}Payment method{% endtrans %}</th>
</tr>
{% for sub in profile.subscriptions.all() %}
<tr>
<td>{{ sub.subscription_start }}</td>
<td>{{ sub.subscription_end }}</td>
<td>{{ sub.subscription_type }}</td>
<td>{{ sub.get_payment_method_display() }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
{% if user == profile or user.is_root or user.is_board_member or user.is_launderette_manager %}
<div>
......@@ -200,6 +220,13 @@ $(function(){
active: false
});
});
$(function(){
$("#drop_subscriptions").accordion({
heightStyle: "content",
collapsible: true,
active: false
});
});
</script>
{% endblock %}
......@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-10 02:17+0200\n"
"POT-Creation-Date: 2018-10-16 00:13+0200\n"
"PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n"
......@@ -142,7 +142,7 @@ msgid "comment"
msgstr "commentaire"
#: accounting/models.py:272 counter/models.py:353 counter/models.py:446
#: subscription/models.py:64
#: subscription/models.py:65
msgid "payment method"
msgstr "méthode de paiement"
......@@ -365,7 +365,7 @@ msgstr "Compte en banque : "
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:93
#: core/templates/core/macros.jinja:112 core/templates/core/page_prop.jinja:14
#: core/templates/core/user_account_detail.jinja:38
#: core/templates/core/user_detail.jinja:157
#: core/templates/core/user_detail.jinja:177
#: core/templates/core/user_edit.jinja:19
#: counter/templates/counter/last_ops.jinja:29
#: counter/templates/counter/last_ops.jinja:59
......@@ -1138,6 +1138,7 @@ msgstr "Total"
#: club/templates/club/club_sellings.jinja:27
#: core/templates/core/user_account_detail.jinja:23
#: core/templates/core/user_account_detail.jinja:54
#: core/templates/core/user_detail.jinja:130
#: counter/templates/counter/last_ops.jinja:18
#: counter/templates/counter/last_ops.jinja:45
#: counter/templates/counter/refilling_list.jinja:14
......@@ -2282,7 +2283,7 @@ msgstr "403, Non autorisé"
msgid "404, Not Found"
msgstr "404. Non trouvé"
#: core/templates/core/500.jinja:8
#: core/templates/core/500.jinja:12
msgid "500, Server Error"
msgstr "500, Erreur Serveur"
......@@ -2986,25 +2987,42 @@ msgstr "Avatar"
msgid "Scrub"
msgstr "Blouse"
#: core/templates/core/user_detail.jinja:133
#: core/templates/core/user_detail.jinja:124
msgid "Subscription history"
msgstr "Historique de cotisation"
#: core/templates/core/user_detail.jinja:127
msgid "Subscription start"
msgstr "Début de la cotisation"
#: core/templates/core/user_detail.jinja:128
msgid "Subscription end"
msgstr "Fin de la cotisation"
#: core/templates/core/user_detail.jinja:129
#: subscription/templates/subscription/stats.jinja:36
msgid "Subscription type"
msgstr "Type de cotisation"
#: core/templates/core/user_detail.jinja:153
msgid "Not subscribed"
msgstr "Non cotisant"
#: core/templates/core/user_detail.jinja:135
#: core/templates/core/user_detail.jinja:155
#: subscription/templates/subscription/subscription.jinja:4
#: subscription/templates/subscription/subscription.jinja:8
msgid "New subscription"
msgstr "Nouvelle cotisation"
#: core/templates/core/user_detail.jinja:148
#: core/templates/core/user_detail.jinja:168
msgid "Give gift"
msgstr "Donner cadeau"
#: core/templates/core/user_detail.jinja:153
#: core/templates/core/user_detail.jinja:173
msgid "Last given gift :"
msgstr "Dernier cadeau donné :"
#: core/templates/core/user_detail.jinja:163
#: core/templates/core/user_detail.jinja:183
msgid "No gift given yet"
msgstr "Aucun cadeau donné pour l'instant"
......@@ -5044,35 +5062,35 @@ msgstr " demandé"
msgid "%(effective_quantity)s left"
msgstr "%(effective_quantity)s restant"
#: subscription/models.py:44
#: subscription/models.py:45
msgid "Bad subscription type"
msgstr "Mauvais type de cotisation"
#: subscription/models.py:49
#: subscription/models.py:50
msgid "Bad payment method"
msgstr "Mauvais type de paiement"
#: subscription/models.py:55
#: subscription/models.py:56
msgid "subscription type"
msgstr "type d'inscription"
#: subscription/models.py:61
#: subscription/models.py:62
msgid "subscription start"
msgstr "début de la cotisation"
#: subscription/models.py:62
#: subscription/models.py:63
msgid "subscription end"
msgstr "fin de la cotisation"
#: subscription/models.py:71
#: subscription/models.py:72
msgid "location"
msgstr "lieu"
#: subscription/models.py:91
#: subscription/models.py:96
msgid "You can not subscribe many time for the same period"
msgstr "Vous ne pouvez pas cotiser plusieurs fois pour la même période"
#: subscription/models.py:96
#: subscription/models.py:101
msgid "Subscription error"
msgstr "Erreur de cotisation"
......@@ -5084,10 +5102,6 @@ msgstr "Cotisations totales"
msgid "Subscriptions by type"
msgstr "Cotisations par type"
#: subscription/templates/subscription/stats.jinja:36
msgid "Subscription type"
msgstr "Type de cotisation"
#: subscription/templates/subscription/subscription.jinja:22
msgid "Eboutic is reserved to specific users. In doubt, don't use it."
msgstr ""
......
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