diff --git a/apps/member/fixtures/initial.json b/apps/member/fixtures/initial.json index d72377f8..e27eb72d 100644 --- a/apps/member/fixtures/initial.json +++ b/apps/member/fixtures/initial.json @@ -6,7 +6,8 @@ "name": "BDE", "email": "tresorerie.bde@example.com", "require_memberships": true, - "membership_fee": 500, + "membership_fee_paid": 500, + "membership_fee_unpaid": 500, "membership_duration": 396, "membership_start": "2019-08-31", "membership_end": "2020-09-30" @@ -20,7 +21,8 @@ "email": "tresorerie.bde@example.com", "parent_club": 1, "require_memberships": true, - "membership_fee": 3500, + "membership_fee_paid": 3500, + "membership_fee_unpaid": 3500, "membership_duration": 396, "membership_start": "2019-08-31", "membership_end": "2020-09-30" diff --git a/apps/member/forms.py b/apps/member/forms.py index 87d5322e..a37d143e 100644 --- a/apps/member/forms.py +++ b/apps/member/forms.py @@ -4,7 +4,6 @@ from django import forms from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.contrib.auth.models import User -from django.utils.translation import gettext_lazy as _ from note_kfet.inputs import Autocomplete, AmountInput, DatePickerInput from permission.models import PermissionMask @@ -46,7 +45,8 @@ class ClubForm(forms.ModelForm): model = Club fields = '__all__' widgets = { - "membership_fee": AmountInput(), + "membership_fee_paid": AmountInput(), + "membership_fee_unpaid": AmountInput(), "parent_club": Autocomplete( Club, attrs={ diff --git a/apps/member/models.py b/apps/member/models.py index 180839d8..47807976 100644 --- a/apps/member/models.py +++ b/apps/member/models.py @@ -9,7 +9,6 @@ from django.core.exceptions import ValidationError, PermissionDenied from django.db import models from django.urls import reverse, reverse_lazy from django.utils.translation import gettext_lazy as _ - from note.models import MembershipTransaction @@ -89,9 +88,14 @@ class Club(models.Model): help_text=_("Uncheck if this club don't require memberships."), ) - membership_fee = models.PositiveIntegerField( + membership_fee_paid = models.PositiveIntegerField( default=0, - verbose_name=_('membership fee'), + verbose_name=_('membership fee (paid students)'), + ) + + membership_fee_unpaid = models.PositiveIntegerField( + default=0, + verbose_name=_('membership fee (unpaid students)'), ) membership_duration = models.PositiveIntegerField( @@ -136,7 +140,8 @@ class Club(models.Model): def save(self, force_insert=False, force_update=False, using=None, update_fields=None): if not self.require_memberships: - self.membership_fee = 0 + self.membership_fee_paid = 0 + self.membership_fee_unpaid = 0 self.membership_duration = None self.membership_start = None self.membership_end = None @@ -225,7 +230,10 @@ class Membership(models.Model): ).exists(): raise ValidationError(_('User is already a member of the club')) - self.fee = self.club.membership_fee + if self.user.profile.paid: + self.fee = self.club.membership_fee_paid + else: + self.fee = self.club.membership_fee_unpaid if self.club.membership_duration is not None: self.date_end = self.date_start + datetime.timedelta(days=self.club.membership_duration) else: @@ -235,18 +243,23 @@ class Membership(models.Model): super().save(*args, **kwargs) - if created and self.fee: - try: - MembershipTransaction.objects.create( - membership=self, - source=self.user.note, - destination=self.club.note, - quantity=1, - amount=self.fee, - reason="Adhésion", - ) - except PermissionDenied: - self.delete() + self.make_transaction() + + def make_transaction(self): + if self.transaction is not None or not self.fee: + return + + if self.fee: + transaction = MembershipTransaction( + membership=self, + source=self.user.note, + destination=self.club.note, + quantity=1, + amount=self.fee, + reason="Adhésion", + ) + transaction._force_save = True + transaction.save(force_insert=True) class Meta: verbose_name = _('membership') diff --git a/apps/member/tables.py b/apps/member/tables.py index 18a2a555..ec21c712 100644 --- a/apps/member/tables.py +++ b/apps/member/tables.py @@ -5,11 +5,10 @@ import django_tables2 as tables from django.contrib.auth.models import User from django.urls import reverse_lazy from django.utils.html import format_html -from django_tables2 import A - from note.templatetags.pretty_money import pretty_money from note_kfet.middlewares import get_current_authenticated_user from permission.backends import PermissionBackend + from .models import Club, Membership diff --git a/apps/member/views.py b/apps/member/views.py index ad01e2a2..226cafab 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -380,7 +380,7 @@ class ClubAddMemberView(ProtectQuerysetMixin, LoginRequiredMixin, CreateView): return super().form_invalid(form) if form.instance.date_start > form.instance.club.membership_end: - form.add_error('user', _("The membership must end before {:%m-%d-%Y}.") + form.add_error('user', _("The membership must begin before {:%m-%d-%Y}.") .format(form.instance.club.membership_start)) return super().form_invalid(form) @@ -412,7 +412,7 @@ class ClubManageRolesView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView): return super().form_invalid(form) if form.instance.date_start > form.instance.club.membership_end: - form.add_error('user', _("The membership must end before {:%m-%d-%Y}.") + form.add_error('user', _("The membership must begin before {:%m-%d-%Y}.") .format(form.instance.club.membership_start)) return super().form_invalid(form) diff --git a/apps/permission/fixtures/initial.json b/apps/permission/fixtures/initial.json index 5bf0d77d..4cf3ecfa 100644 --- a/apps/permission/fixtures/initial.json +++ b/apps/permission/fixtures/initial.json @@ -798,6 +798,51 @@ "description": "Update club" } }, + { + "model": "permission.permission", + "pk": 48, + "fields": { + "model": [ + "member", + "membership" + ], + "query": "{\"user\": [\"user\"]}", + "type": "view", + "mask": 1, + "field": "", + "description": "View our memberships" + } + }, + { + "model": "permission.permission", + "pk": 49, + "fields": { + "model": [ + "member", + "membership" + ], + "query": "{\"club\": [\"club\"]}", + "type": "view", + "mask": 1, + "field": "", + "description": "View club's memberships" + } + }, + { + "model": "permission.permission", + "pk": 50, + "fields": { + "model": [ + "member", + "membership" + ], + "query": "{\"club\": [\"club\"]}", + "type": "add", + "mask": 2, + "field": "", + "description": "Add a membership to a club" + } + }, { "model": "permission.rolepermissions", "pk": 1, @@ -810,7 +855,8 @@ 8, 9, 10, - 11 + 11, + 48 ] } }, @@ -906,5 +952,64 @@ 47 ] } + }, + { + "model": "permission.rolepermissions", + "pk": 7, + "fields": { + "role": 5, + "permissions": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50 + ] + } } ] diff --git a/apps/permission/models.py b/apps/permission/models.py index c8df07c0..b1012159 100644 --- a/apps/permission/models.py +++ b/apps/permission/models.py @@ -49,6 +49,8 @@ class InstancedPermission: # Force insertion, no data verification, no trigger obj._force_save = True Model.save(obj, force_insert=True) + # We don't want log anything + obj._no_log = True ret = self.model.model_class().objects.filter(self.query & Q(pk=obj.pk)).exists() # Delete testing object obj._force_delete = True diff --git a/apps/permission/signals.py b/apps/permission/signals.py index 5ccb9c0b..3bb79897 100644 --- a/apps/permission/signals.py +++ b/apps/permission/signals.py @@ -2,8 +2,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later from django.core.exceptions import PermissionDenied -from django.db.models.signals import pre_save, pre_delete, post_save, post_delete -from logs import signals as logs_signals from note_kfet.middlewares import get_current_authenticated_user from permission.backends import PermissionBackend @@ -29,7 +27,7 @@ def pre_save_object(sender, instance, **kwargs): if instance._meta.label_lower in EXCLUDED: return - if hasattr(instance, "_force_save"): + if hasattr(instance, "_no_log"): return user = get_current_authenticated_user() @@ -76,7 +74,7 @@ def pre_delete_object(instance, **kwargs): if instance._meta.label_lower in EXCLUDED: return - if hasattr(instance, "_force_delete"): + if hasattr(instance, "_no_log"): return user = get_current_authenticated_user() diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index a4bfb939..9348a93a 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-31 23:49+0200\n" +"POT-Creation-Date: 2020-04-01 04:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -44,9 +44,9 @@ msgid "You can't invite more than 3 people to this activity." msgstr "" #: apps/activity/models.py:23 apps/activity/models.py:48 -#: apps/member/models.py:64 apps/member/models.py:158 +#: apps/member/models.py:66 apps/member/models.py:166 #: apps/note/models/notes.py:188 apps/note/models/transactions.py:24 -#: apps/note/models/transactions.py:44 apps/note/models/transactions.py:231 +#: apps/note/models/transactions.py:44 apps/note/models/transactions.py:232 #: templates/member/club_info.html:13 templates/member/profile_info.html:14 msgid "name" msgstr "" @@ -68,7 +68,7 @@ msgid "activity types" msgstr "" #: apps/activity/models.py:53 apps/note/models/transactions.py:69 -#: apps/permission/models.py:99 templates/activity/activity_detail.html:16 +#: apps/permission/models.py:103 templates/activity/activity_detail.html:16 msgid "description" msgstr "" @@ -251,129 +251,145 @@ msgstr "" msgid "member" msgstr "" -#: apps/member/models.py:26 +#: apps/member/models.py:28 msgid "phone number" msgstr "" -#: apps/member/models.py:32 templates/member/profile_info.html:27 +#: apps/member/models.py:34 templates/member/profile_info.html:27 msgid "section" msgstr "" -#: apps/member/models.py:33 +#: apps/member/models.py:35 msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\"" msgstr "" -#: apps/member/models.py:39 templates/member/profile_info.html:30 +#: apps/member/models.py:41 templates/member/profile_info.html:30 msgid "address" msgstr "" -#: apps/member/models.py:45 +#: apps/member/models.py:47 msgid "paid" msgstr "" -#: apps/member/models.py:50 apps/member/models.py:51 +#: apps/member/models.py:52 apps/member/models.py:53 msgid "user profile" msgstr "" -#: apps/member/models.py:69 templates/member/club_info.html:38 +#: apps/member/models.py:71 templates/member/club_info.html:41 msgid "email" msgstr "" -#: apps/member/models.py:76 +#: apps/member/models.py:78 msgid "parent club" msgstr "" -#: apps/member/models.py:85 +#: apps/member/models.py:87 msgid "require memberships" msgstr "" -#: apps/member/models.py:86 +#: apps/member/models.py:88 msgid "Uncheck if this club don't require memberships." msgstr "" -#: apps/member/models.py:91 templates/member/club_info.html:31 -msgid "membership fee" +#: apps/member/models.py:93 templates/member/club_info.html:31 +msgid "membership fee (paid students)" msgstr "" -#: apps/member/models.py:97 templates/member/club_info.html:28 +#: apps/member/models.py:98 templates/member/club_info.html:34 +msgid "membership fee (unpaid students)" +msgstr "" + +#: apps/member/models.py:104 templates/member/club_info.html:28 msgid "membership duration" msgstr "" -#: apps/member/models.py:98 +#: apps/member/models.py:105 msgid "The longest time (in days) a membership can last (NULL = infinite)." msgstr "" -#: apps/member/models.py:105 templates/member/club_info.html:22 +#: apps/member/models.py:112 templates/member/club_info.html:22 msgid "membership start" msgstr "" -#: apps/member/models.py:106 +#: apps/member/models.py:113 msgid "How long after January 1st the members can renew their membership." msgstr "" -#: apps/member/models.py:113 templates/member/club_info.html:25 +#: apps/member/models.py:120 templates/member/club_info.html:25 msgid "membership end" msgstr "" -#: apps/member/models.py:114 +#: apps/member/models.py:121 msgid "" "How long the membership can last after January 1st of the next year after " "members can renew their membership." msgstr "" -#: apps/member/models.py:143 apps/note/models/notes.py:139 +#: apps/member/models.py:151 apps/note/models/notes.py:139 msgid "club" msgstr "" -#: apps/member/models.py:144 +#: apps/member/models.py:152 msgid "clubs" msgstr "" -#: apps/member/models.py:164 apps/permission/models.py:284 +#: apps/member/models.py:172 apps/permission/models.py:288 msgid "role" msgstr "" -#: apps/member/models.py:165 +#: apps/member/models.py:173 apps/member/models.py:196 msgid "roles" msgstr "" -#: apps/member/models.py:191 +#: apps/member/models.py:200 msgid "membership starts on" msgstr "" -#: apps/member/models.py:195 +#: apps/member/models.py:204 msgid "membership ends on" msgstr "" -#: apps/member/models.py:200 +#: apps/member/models.py:209 msgid "fee" msgstr "" -#: apps/member/models.py:212 +#: apps/member/models.py:221 apps/member/views.py:365 msgid "User is not a member of the parent club" msgstr "" -#: apps/member/models.py:224 +#: apps/member/models.py:231 apps/member/views.py:374 +msgid "User is already a member of the club" +msgstr "" + +#: apps/member/models.py:265 msgid "membership" msgstr "" -#: apps/member/models.py:225 +#: apps/member/models.py:266 msgid "memberships" msgstr "" -#: apps/member/views.py:77 templates/member/profile_info.html:45 +#: apps/member/views.py:78 templates/member/profile_info.html:45 msgid "Update Profile" msgstr "" -#: apps/member/views.py:90 +#: apps/member/views.py:91 msgid "An alias with a similar name already exists." msgstr "" +#: apps/member/views.py:378 apps/member/views.py:410 +msgid "The membership must start after {:%m-%d-%Y}." +msgstr "" + +#: apps/member/views.py:383 apps/member/views.py:415 +msgid "The membership must start before {:%m-%d-%Y}." +msgstr "" + #: apps/note/admin.py:120 apps/note/models/transactions.py:94 msgid "source" msgstr "" -#: apps/note/admin.py:128 apps/note/admin.py:156 +#: apps/note/admin.py:128 apps/note/admin.py:163 #: apps/note/models/transactions.py:53 apps/note/models/transactions.py:107 msgid "destination" msgstr "" @@ -470,7 +486,7 @@ msgstr "" msgid "alias" msgstr "" -#: apps/note/models/notes.py:211 templates/member/club_info.html:35 +#: apps/note/models/notes.py:211 templates/member/club_info.html:38 #: templates/member/profile_info.html:36 msgid "aliases" msgstr "" @@ -532,45 +548,45 @@ msgstr "" msgid "invalidity reason" msgstr "" -#: apps/note/models/transactions.py:146 +#: apps/note/models/transactions.py:147 msgid "transaction" msgstr "" -#: apps/note/models/transactions.py:147 +#: apps/note/models/transactions.py:148 msgid "transactions" msgstr "" -#: apps/note/models/transactions.py:201 templates/base.html:84 +#: apps/note/models/transactions.py:202 templates/base.html:84 #: templates/note/transaction_form.html:19 #: templates/note/transaction_form.html:140 msgid "Transfer" msgstr "" -#: apps/note/models/transactions.py:221 +#: apps/note/models/transactions.py:222 msgid "Template" msgstr "" -#: apps/note/models/transactions.py:236 +#: apps/note/models/transactions.py:237 msgid "first_name" msgstr "" -#: apps/note/models/transactions.py:241 +#: apps/note/models/transactions.py:242 msgid "bank" msgstr "" -#: apps/note/models/transactions.py:247 templates/note/transaction_form.html:24 +#: apps/note/models/transactions.py:248 templates/note/transaction_form.html:24 msgid "Credit" msgstr "" -#: apps/note/models/transactions.py:247 templates/note/transaction_form.html:28 +#: apps/note/models/transactions.py:248 templates/note/transaction_form.html:28 msgid "Debit" msgstr "" -#: apps/note/models/transactions.py:263 apps/note/models/transactions.py:268 +#: apps/note/models/transactions.py:264 apps/note/models/transactions.py:269 msgid "membership transaction" msgstr "" -#: apps/note/models/transactions.py:264 +#: apps/note/models/transactions.py:265 msgid "membership transactions" msgstr "" @@ -594,21 +610,21 @@ msgstr "" msgid "Consumptions" msgstr "" -#: apps/permission/models.py:78 apps/permission/models.py:271 +#: apps/permission/models.py:82 apps/permission/models.py:275 #, python-brace-format msgid "Can {type} {model}.{field} in {query}" msgstr "" -#: apps/permission/models.py:80 apps/permission/models.py:273 +#: apps/permission/models.py:84 apps/permission/models.py:277 #, python-brace-format msgid "Can {type} {model} in {query}" msgstr "" -#: apps/permission/models.py:93 +#: apps/permission/models.py:97 msgid "rank" msgstr "" -#: apps/permission/models.py:156 +#: apps/permission/models.py:160 msgid "Specifying field applies only to view and change permission types." msgstr "" @@ -892,19 +908,15 @@ msgstr "" msgid "days" msgstr "" -#: templates/member/club_info.html:43 +#: templates/member/club_info.html:47 msgid "Add member" msgstr "" -#: templates/member/club_info.html:44 templates/note/conso_form.html:121 +#: templates/member/club_info.html:50 templates/note/conso_form.html:121 msgid "Edit" msgstr "" -#: templates/member/club_info.html:45 -msgid "Add roles" -msgstr "" - -#: templates/member/club_info.html:48 templates/member/profile_info.html:48 +#: templates/member/club_info.html:54 templates/member/profile_info.html:48 msgid "View Profile" msgstr "" diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index f4568da4..aeb565cc 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-31 23:49+0200\n" +"POT-Creation-Date: 2020-04-01 04:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,9 +40,9 @@ msgid "You can't invite more than 3 people to this activity." msgstr "Vous ne pouvez pas inviter plus de 3 personnes à cette activité." #: apps/activity/models.py:23 apps/activity/models.py:48 -#: apps/member/models.py:64 apps/member/models.py:158 +#: apps/member/models.py:66 apps/member/models.py:166 #: apps/note/models/notes.py:188 apps/note/models/transactions.py:24 -#: apps/note/models/transactions.py:44 apps/note/models/transactions.py:231 +#: apps/note/models/transactions.py:44 apps/note/models/transactions.py:232 #: templates/member/club_info.html:13 templates/member/profile_info.html:14 msgid "name" msgstr "nom" @@ -64,7 +64,7 @@ msgid "activity types" msgstr "types d'activité" #: apps/activity/models.py:53 apps/note/models/transactions.py:69 -#: apps/permission/models.py:99 templates/activity/activity_detail.html:16 +#: apps/permission/models.py:103 templates/activity/activity_detail.html:16 msgid "description" msgstr "description" @@ -247,73 +247,77 @@ msgstr "Les logs ne peuvent pas être détruits." msgid "member" msgstr "adhérent" -#: apps/member/models.py:26 +#: apps/member/models.py:28 msgid "phone number" msgstr "numéro de téléphone" -#: apps/member/models.py:32 templates/member/profile_info.html:27 +#: apps/member/models.py:34 templates/member/profile_info.html:27 msgid "section" msgstr "section" -#: apps/member/models.py:33 +#: apps/member/models.py:35 msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\"" msgstr "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\"" -#: apps/member/models.py:39 templates/member/profile_info.html:30 +#: apps/member/models.py:41 templates/member/profile_info.html:30 msgid "address" msgstr "adresse" -#: apps/member/models.py:45 +#: apps/member/models.py:47 msgid "paid" msgstr "payé" -#: apps/member/models.py:50 apps/member/models.py:51 +#: apps/member/models.py:52 apps/member/models.py:53 msgid "user profile" msgstr "profil utilisateur" -#: apps/member/models.py:69 templates/member/club_info.html:38 +#: apps/member/models.py:71 templates/member/club_info.html:41 msgid "email" msgstr "courriel" -#: apps/member/models.py:76 +#: apps/member/models.py:78 msgid "parent club" msgstr "club parent" -#: apps/member/models.py:85 +#: apps/member/models.py:87 msgid "require memberships" msgstr "nécessite des adhésions" -#: apps/member/models.py:86 +#: apps/member/models.py:88 msgid "Uncheck if this club don't require memberships." msgstr "Décochez si ce club n'utilise pas d'adhésions." -#: apps/member/models.py:91 templates/member/club_info.html:31 -msgid "membership fee" -msgstr "cotisation pour adhérer" +#: apps/member/models.py:93 templates/member/club_info.html:31 +msgid "membership fee (paid students)" +msgstr "cotisation pour adhérer (normalien élève)" -#: apps/member/models.py:97 templates/member/club_info.html:28 +#: apps/member/models.py:98 templates/member/club_info.html:34 +msgid "membership fee (unpaid students)" +msgstr "cotisation pour adhérer (normalien étudiant)" + +#: apps/member/models.py:104 templates/member/club_info.html:28 msgid "membership duration" msgstr "durée de l'adhésion" -#: apps/member/models.py:98 +#: apps/member/models.py:105 msgid "The longest time (in days) a membership can last (NULL = infinite)." msgstr "La durée maximale (en jours) d'une adhésion (NULL = infinie)." -#: apps/member/models.py:105 templates/member/club_info.html:22 +#: apps/member/models.py:112 templates/member/club_info.html:22 msgid "membership start" msgstr "début de l'adhésion" -#: apps/member/models.py:106 +#: apps/member/models.py:113 msgid "How long after January 1st the members can renew their membership." msgstr "" "Combien de temps après le 1er Janvier les adhérents peuvent renouveler leur " "adhésion." -#: apps/member/models.py:113 templates/member/club_info.html:25 +#: apps/member/models.py:120 templates/member/club_info.html:25 msgid "membership end" msgstr "fin de l'adhésion" -#: apps/member/models.py:114 +#: apps/member/models.py:121 msgid "" "How long the membership can last after January 1st of the next year after " "members can renew their membership." @@ -321,59 +325,71 @@ msgstr "" "Combien de temps l'adhésion peut durer après le 1er Janvier de l'année " "suivante avant que les adhérents peuvent renouveler leur adhésion." -#: apps/member/models.py:143 apps/note/models/notes.py:139 +#: apps/member/models.py:151 apps/note/models/notes.py:139 msgid "club" msgstr "club" -#: apps/member/models.py:144 +#: apps/member/models.py:152 msgid "clubs" msgstr "clubs" -#: apps/member/models.py:164 apps/permission/models.py:284 +#: apps/member/models.py:172 apps/permission/models.py:288 msgid "role" msgstr "rôle" -#: apps/member/models.py:165 +#: apps/member/models.py:173 apps/member/models.py:196 msgid "roles" msgstr "rôles" -#: apps/member/models.py:191 +#: apps/member/models.py:200 msgid "membership starts on" msgstr "l'adhésion commence le" -#: apps/member/models.py:195 +#: apps/member/models.py:204 msgid "membership ends on" -msgstr "l'adhésion finie le" +msgstr "l'adhésion finit le" -#: apps/member/models.py:200 +#: apps/member/models.py:209 msgid "fee" msgstr "cotisation" -#: apps/member/models.py:212 +#: apps/member/models.py:221 apps/member/views.py:365 msgid "User is not a member of the parent club" msgstr "L'utilisateur n'est pas membre du club parent" -#: apps/member/models.py:224 +#: apps/member/models.py:231 apps/member/views.py:374 +msgid "User is already a member of the club" +msgstr "L'utilisateur est déjà membre du club" + +#: apps/member/models.py:265 msgid "membership" msgstr "adhésion" -#: apps/member/models.py:225 +#: apps/member/models.py:266 msgid "memberships" msgstr "adhésions" -#: apps/member/views.py:77 templates/member/profile_info.html:45 +#: apps/member/views.py:78 templates/member/profile_info.html:45 msgid "Update Profile" msgstr "Modifier le profil" -#: apps/member/views.py:90 +#: apps/member/views.py:91 msgid "An alias with a similar name already exists." msgstr "Un alias avec un nom similaire existe déjà." +#: apps/member/views.py:378 apps/member/views.py:410 +msgid "The membership must start after {:%m-%d-%Y}." +msgstr "L'adhésion doit commencer après le {:%d/%m/%Y}." + +#: apps/member/views.py:383 apps/member/views.py:415 +msgid "The membership must begin before {:%m-%d-%Y}." +msgstr "L'adhésion doit commencer avant le {:%d/%m/%Y}." + #: apps/note/admin.py:120 apps/note/models/transactions.py:94 msgid "source" msgstr "source" -#: apps/note/admin.py:128 apps/note/admin.py:156 +#: apps/note/admin.py:128 apps/note/admin.py:163 #: apps/note/models/transactions.py:53 apps/note/models/transactions.py:107 msgid "destination" msgstr "destination" @@ -471,7 +487,7 @@ msgstr "Alias invalide" msgid "alias" msgstr "alias" -#: apps/note/models/notes.py:211 templates/member/club_info.html:35 +#: apps/note/models/notes.py:211 templates/member/club_info.html:38 #: templates/member/profile_info.html:36 msgid "aliases" msgstr "alias" @@ -533,45 +549,45 @@ msgstr "raison" msgid "invalidity reason" msgstr "Motif d'invalidité" -#: apps/note/models/transactions.py:146 +#: apps/note/models/transactions.py:147 msgid "transaction" msgstr "transaction" -#: apps/note/models/transactions.py:147 +#: apps/note/models/transactions.py:148 msgid "transactions" msgstr "transactions" -#: apps/note/models/transactions.py:201 templates/base.html:84 +#: apps/note/models/transactions.py:202 templates/base.html:84 #: templates/note/transaction_form.html:19 #: templates/note/transaction_form.html:140 msgid "Transfer" msgstr "Virement" -#: apps/note/models/transactions.py:221 +#: apps/note/models/transactions.py:222 msgid "Template" msgstr "Bouton" -#: apps/note/models/transactions.py:236 +#: apps/note/models/transactions.py:237 msgid "first_name" msgstr "prénom" -#: apps/note/models/transactions.py:241 +#: apps/note/models/transactions.py:242 msgid "bank" msgstr "banque" -#: apps/note/models/transactions.py:247 templates/note/transaction_form.html:24 +#: apps/note/models/transactions.py:248 templates/note/transaction_form.html:24 msgid "Credit" msgstr "Crédit" -#: apps/note/models/transactions.py:247 templates/note/transaction_form.html:28 +#: apps/note/models/transactions.py:248 templates/note/transaction_form.html:28 msgid "Debit" msgstr "Débit" -#: apps/note/models/transactions.py:263 apps/note/models/transactions.py:268 +#: apps/note/models/transactions.py:264 apps/note/models/transactions.py:269 msgid "membership transaction" msgstr "transaction d'adhésion" -#: apps/note/models/transactions.py:264 +#: apps/note/models/transactions.py:265 msgid "membership transactions" msgstr "transactions d'adhésion" @@ -595,21 +611,21 @@ msgstr "Transférer de l'argent" msgid "Consumptions" msgstr "Consommations" -#: apps/permission/models.py:78 apps/permission/models.py:271 +#: apps/permission/models.py:82 apps/permission/models.py:275 #, python-brace-format msgid "Can {type} {model}.{field} in {query}" msgstr "" -#: apps/permission/models.py:80 apps/permission/models.py:273 +#: apps/permission/models.py:84 apps/permission/models.py:277 #, python-brace-format msgid "Can {type} {model} in {query}" msgstr "" -#: apps/permission/models.py:93 +#: apps/permission/models.py:97 msgid "rank" msgstr "Rang" -#: apps/permission/models.py:156 +#: apps/permission/models.py:160 msgid "Specifying field applies only to view and change permission types." msgstr "" @@ -895,19 +911,15 @@ msgstr "Club parent" msgid "days" msgstr "jours" -#: templates/member/club_info.html:43 +#: templates/member/club_info.html:47 msgid "Add member" msgstr "Ajouter un membre" -#: templates/member/club_info.html:44 templates/note/conso_form.html:121 +#: templates/member/club_info.html:50 templates/note/conso_form.html:121 msgid "Edit" msgstr "Éditer" -#: templates/member/club_info.html:45 -msgid "Add roles" -msgstr "Ajouter des rôles" - -#: templates/member/club_info.html:48 templates/member/profile_info.html:48 +#: templates/member/club_info.html:54 templates/member/profile_info.html:48 msgid "View Profile" msgstr "Voir le profil" @@ -1217,5 +1229,8 @@ msgstr "Il n'y a pas de transaction associée à une remise ouverte." msgid "Closed remittances" msgstr "Remises fermées" +#~ msgid "Add roles" +#~ msgstr "Ajouter des rôles" + #~ msgid "linked notes" #~ msgstr "notes liées" diff --git a/templates/member/club_form.html b/templates/member/club_form.html index 7abe9db9..9810ccab 100644 --- a/templates/member/club_form.html +++ b/templates/member/club_form.html @@ -15,14 +15,16 @@ require_memberships_obj = $("#id_require_memberships"); if (!require_memberships_obj.is(":checked")) { - $("#div_id_membership_fee").toggle(); + $("#div_id_membership_fee_paid").toggle(); + $("#div_id_membership_fee_unpaid").toggle(); $("#div_id_membership_duration").toggle(); $("#div_id_membership_start").toggle(); $("#div_id_membership_end").toggle(); } require_memberships_obj.change(function () { - $("#div_id_membership_fee").toggle(); + $("#div_id_membership_fee_paid").toggle(); + $("#div_id_membership_fee_unpaid").toggle(); $("#div_id_membership_duration").toggle(); $("#div_id_membership_start").toggle(); $("#div_id_membership_end").toggle(); diff --git a/templates/member/club_info.html b/templates/member/club_info.html index 23a41c1c..ef5c59f1 100644 --- a/templates/member/club_info.html +++ b/templates/member/club_info.html @@ -28,8 +28,11 @@
{% trans 'membership duration'|capfirst %}
{{ club.membership_duration }} {% trans "days" %}
-
{% trans 'membership fee'|capfirst %}
-
{{ club.membership_fee|pretty_money }}
+
{% trans 'membership fee (paid students)'|capfirst %}
+
{{ club.membership_fee_paid|pretty_money }}
+ +
{% trans 'membership fee (unpaid students)'|capfirst %}
+
{{ club.membership_fee_unpaid|pretty_money }}
{% endif %}
{% trans 'aliases'|capfirst %}