Membership fees for paid and unpaid students, closes #43

This commit is contained in:
Yohann D'ANELLO 2020-04-01 04:07:55 +02:00
parent d5b010980b
commit 0df0f3f66b
12 changed files with 301 additions and 150 deletions

View File

@ -6,7 +6,8 @@
"name": "BDE", "name": "BDE",
"email": "tresorerie.bde@example.com", "email": "tresorerie.bde@example.com",
"require_memberships": true, "require_memberships": true,
"membership_fee": 500, "membership_fee_paid": 500,
"membership_fee_unpaid": 500,
"membership_duration": 396, "membership_duration": 396,
"membership_start": "2019-08-31", "membership_start": "2019-08-31",
"membership_end": "2020-09-30" "membership_end": "2020-09-30"
@ -20,7 +21,8 @@
"email": "tresorerie.bde@example.com", "email": "tresorerie.bde@example.com",
"parent_club": 1, "parent_club": 1,
"require_memberships": true, "require_memberships": true,
"membership_fee": 3500, "membership_fee_paid": 3500,
"membership_fee_unpaid": 3500,
"membership_duration": 396, "membership_duration": 396,
"membership_start": "2019-08-31", "membership_start": "2019-08-31",
"membership_end": "2020-09-30" "membership_end": "2020-09-30"

View File

@ -4,7 +4,6 @@
from django import forms from django import forms
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
from note_kfet.inputs import Autocomplete, AmountInput, DatePickerInput from note_kfet.inputs import Autocomplete, AmountInput, DatePickerInput
from permission.models import PermissionMask from permission.models import PermissionMask
@ -46,7 +45,8 @@ class ClubForm(forms.ModelForm):
model = Club model = Club
fields = '__all__' fields = '__all__'
widgets = { widgets = {
"membership_fee": AmountInput(), "membership_fee_paid": AmountInput(),
"membership_fee_unpaid": AmountInput(),
"parent_club": Autocomplete( "parent_club": Autocomplete(
Club, Club,
attrs={ attrs={

View File

@ -9,7 +9,6 @@ from django.core.exceptions import ValidationError, PermissionDenied
from django.db import models from django.db import models
from django.urls import reverse, reverse_lazy from django.urls import reverse, reverse_lazy
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from note.models import MembershipTransaction from note.models import MembershipTransaction
@ -89,9 +88,14 @@ class Club(models.Model):
help_text=_("Uncheck if this club don't require memberships."), help_text=_("Uncheck if this club don't require memberships."),
) )
membership_fee = models.PositiveIntegerField( membership_fee_paid = models.PositiveIntegerField(
default=0, 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( membership_duration = models.PositiveIntegerField(
@ -136,7 +140,8 @@ class Club(models.Model):
def save(self, force_insert=False, force_update=False, using=None, def save(self, force_insert=False, force_update=False, using=None,
update_fields=None): update_fields=None):
if not self.require_memberships: 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_duration = None
self.membership_start = None self.membership_start = None
self.membership_end = None self.membership_end = None
@ -225,7 +230,10 @@ class Membership(models.Model):
).exists(): ).exists():
raise ValidationError(_('User is already a member of the club')) 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: if self.club.membership_duration is not None:
self.date_end = self.date_start + datetime.timedelta(days=self.club.membership_duration) self.date_end = self.date_start + datetime.timedelta(days=self.club.membership_duration)
else: else:
@ -235,9 +243,14 @@ class Membership(models.Model):
super().save(*args, **kwargs) super().save(*args, **kwargs)
if created and self.fee: self.make_transaction()
try:
MembershipTransaction.objects.create( def make_transaction(self):
if self.transaction is not None or not self.fee:
return
if self.fee:
transaction = MembershipTransaction(
membership=self, membership=self,
source=self.user.note, source=self.user.note,
destination=self.club.note, destination=self.club.note,
@ -245,8 +258,8 @@ class Membership(models.Model):
amount=self.fee, amount=self.fee,
reason="Adhésion", reason="Adhésion",
) )
except PermissionDenied: transaction._force_save = True
self.delete() transaction.save(force_insert=True)
class Meta: class Meta:
verbose_name = _('membership') verbose_name = _('membership')

View File

@ -5,11 +5,10 @@ import django_tables2 as tables
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.html import format_html from django.utils.html import format_html
from django_tables2 import A
from note.templatetags.pretty_money import pretty_money from note.templatetags.pretty_money import pretty_money
from note_kfet.middlewares import get_current_authenticated_user from note_kfet.middlewares import get_current_authenticated_user
from permission.backends import PermissionBackend from permission.backends import PermissionBackend
from .models import Club, Membership from .models import Club, Membership

View File

@ -380,7 +380,7 @@ class ClubAddMemberView(ProtectQuerysetMixin, LoginRequiredMixin, CreateView):
return super().form_invalid(form) return super().form_invalid(form)
if form.instance.date_start > form.instance.club.membership_end: 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)) .format(form.instance.club.membership_start))
return super().form_invalid(form) return super().form_invalid(form)
@ -412,7 +412,7 @@ class ClubManageRolesView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView):
return super().form_invalid(form) return super().form_invalid(form)
if form.instance.date_start > form.instance.club.membership_end: 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)) .format(form.instance.club.membership_start))
return super().form_invalid(form) return super().form_invalid(form)

View File

@ -798,6 +798,51 @@
"description": "Update club" "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", "model": "permission.rolepermissions",
"pk": 1, "pk": 1,
@ -810,7 +855,8 @@
8, 8,
9, 9,
10, 10,
11 11,
48
] ]
} }
}, },
@ -906,5 +952,64 @@
47 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
]
}
} }
] ]

View File

@ -49,6 +49,8 @@ class InstancedPermission:
# Force insertion, no data verification, no trigger # Force insertion, no data verification, no trigger
obj._force_save = True obj._force_save = True
Model.save(obj, force_insert=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() ret = self.model.model_class().objects.filter(self.query & Q(pk=obj.pk)).exists()
# Delete testing object # Delete testing object
obj._force_delete = True obj._force_delete = True

View File

@ -2,8 +2,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from django.core.exceptions import PermissionDenied 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 note_kfet.middlewares import get_current_authenticated_user
from permission.backends import PermissionBackend from permission.backends import PermissionBackend
@ -29,7 +27,7 @@ def pre_save_object(sender, instance, **kwargs):
if instance._meta.label_lower in EXCLUDED: if instance._meta.label_lower in EXCLUDED:
return return
if hasattr(instance, "_force_save"): if hasattr(instance, "_no_log"):
return return
user = get_current_authenticated_user() user = get_current_authenticated_user()
@ -76,7 +74,7 @@ def pre_delete_object(instance, **kwargs):
if instance._meta.label_lower in EXCLUDED: if instance._meta.label_lower in EXCLUDED:
return return
if hasattr(instance, "_force_delete"): if hasattr(instance, "_no_log"):
return return
user = get_current_authenticated_user() user = get_current_authenticated_user()

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -44,9 +44,9 @@ msgid "You can't invite more than 3 people to this activity."
msgstr "" msgstr ""
#: apps/activity/models.py:23 apps/activity/models.py:48 #: 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/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 #: templates/member/club_info.html:13 templates/member/profile_info.html:14
msgid "name" msgid "name"
msgstr "" msgstr ""
@ -68,7 +68,7 @@ msgid "activity types"
msgstr "" msgstr ""
#: apps/activity/models.py:53 apps/note/models/transactions.py:69 #: 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" msgid "description"
msgstr "" msgstr ""
@ -251,129 +251,145 @@ msgstr ""
msgid "member" msgid "member"
msgstr "" msgstr ""
#: apps/member/models.py:26 #: apps/member/models.py:28
msgid "phone number" msgid "phone number"
msgstr "" 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" msgid "section"
msgstr "" msgstr ""
#: apps/member/models.py:33 #: apps/member/models.py:35
msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\"" msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\""
msgstr "" 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" msgid "address"
msgstr "" msgstr ""
#: apps/member/models.py:45 #: apps/member/models.py:47
msgid "paid" msgid "paid"
msgstr "" msgstr ""
#: apps/member/models.py:50 apps/member/models.py:51 #: apps/member/models.py:52 apps/member/models.py:53
msgid "user profile" msgid "user profile"
msgstr "" 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" msgid "email"
msgstr "" msgstr ""
#: apps/member/models.py:76 #: apps/member/models.py:78
msgid "parent club" msgid "parent club"
msgstr "" msgstr ""
#: apps/member/models.py:85 #: apps/member/models.py:87
msgid "require memberships" msgid "require memberships"
msgstr "" msgstr ""
#: apps/member/models.py:86 #: apps/member/models.py:88
msgid "Uncheck if this club don't require memberships." msgid "Uncheck if this club don't require memberships."
msgstr "" msgstr ""
#: apps/member/models.py:91 templates/member/club_info.html:31 #: apps/member/models.py:93 templates/member/club_info.html:31
msgid "membership fee" msgid "membership fee (paid students)"
msgstr "" 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" msgid "membership duration"
msgstr "" msgstr ""
#: apps/member/models.py:98 #: apps/member/models.py:105
msgid "The longest time (in days) a membership can last (NULL = infinite)." msgid "The longest time (in days) a membership can last (NULL = infinite)."
msgstr "" 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" msgid "membership start"
msgstr "" msgstr ""
#: apps/member/models.py:106 #: apps/member/models.py:113
msgid "How long after January 1st the members can renew their membership." msgid "How long after January 1st the members can renew their membership."
msgstr "" 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" msgid "membership end"
msgstr "" msgstr ""
#: apps/member/models.py:114 #: apps/member/models.py:121
msgid "" msgid ""
"How long the membership can last after January 1st of the next year after " "How long the membership can last after January 1st of the next year after "
"members can renew their membership." "members can renew their membership."
msgstr "" 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" msgid "club"
msgstr "" msgstr ""
#: apps/member/models.py:144 #: apps/member/models.py:152
msgid "clubs" msgid "clubs"
msgstr "" msgstr ""
#: apps/member/models.py:164 apps/permission/models.py:284 #: apps/member/models.py:172 apps/permission/models.py:288
msgid "role" msgid "role"
msgstr "" msgstr ""
#: apps/member/models.py:165 #: apps/member/models.py:173 apps/member/models.py:196
msgid "roles" msgid "roles"
msgstr "" msgstr ""
#: apps/member/models.py:191 #: apps/member/models.py:200
msgid "membership starts on" msgid "membership starts on"
msgstr "" msgstr ""
#: apps/member/models.py:195 #: apps/member/models.py:204
msgid "membership ends on" msgid "membership ends on"
msgstr "" msgstr ""
#: apps/member/models.py:200 #: apps/member/models.py:209
msgid "fee" msgid "fee"
msgstr "" 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" msgid "User is not a member of the parent club"
msgstr "" 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" msgid "membership"
msgstr "" msgstr ""
#: apps/member/models.py:225 #: apps/member/models.py:266
msgid "memberships" msgid "memberships"
msgstr "" 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" msgid "Update Profile"
msgstr "" msgstr ""
#: apps/member/views.py:90 #: apps/member/views.py:91
msgid "An alias with a similar name already exists." msgid "An alias with a similar name already exists."
msgstr "" 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 #: apps/note/admin.py:120 apps/note/models/transactions.py:94
msgid "source" msgid "source"
msgstr "" 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 #: apps/note/models/transactions.py:53 apps/note/models/transactions.py:107
msgid "destination" msgid "destination"
msgstr "" msgstr ""
@ -470,7 +486,7 @@ msgstr ""
msgid "alias" msgid "alias"
msgstr "" 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 #: templates/member/profile_info.html:36
msgid "aliases" msgid "aliases"
msgstr "" msgstr ""
@ -532,45 +548,45 @@ msgstr ""
msgid "invalidity reason" msgid "invalidity reason"
msgstr "" msgstr ""
#: apps/note/models/transactions.py:146 #: apps/note/models/transactions.py:147
msgid "transaction" msgid "transaction"
msgstr "" msgstr ""
#: apps/note/models/transactions.py:147 #: apps/note/models/transactions.py:148
msgid "transactions" msgid "transactions"
msgstr "" 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:19
#: templates/note/transaction_form.html:140 #: templates/note/transaction_form.html:140
msgid "Transfer" msgid "Transfer"
msgstr "" msgstr ""
#: apps/note/models/transactions.py:221 #: apps/note/models/transactions.py:222
msgid "Template" msgid "Template"
msgstr "" msgstr ""
#: apps/note/models/transactions.py:236 #: apps/note/models/transactions.py:237
msgid "first_name" msgid "first_name"
msgstr "" msgstr ""
#: apps/note/models/transactions.py:241 #: apps/note/models/transactions.py:242
msgid "bank" msgid "bank"
msgstr "" 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" msgid "Credit"
msgstr "" 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" msgid "Debit"
msgstr "" 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" msgid "membership transaction"
msgstr "" msgstr ""
#: apps/note/models/transactions.py:264 #: apps/note/models/transactions.py:265
msgid "membership transactions" msgid "membership transactions"
msgstr "" msgstr ""
@ -594,21 +610,21 @@ msgstr ""
msgid "Consumptions" msgid "Consumptions"
msgstr "" msgstr ""
#: apps/permission/models.py:78 apps/permission/models.py:271 #: apps/permission/models.py:82 apps/permission/models.py:275
#, python-brace-format #, python-brace-format
msgid "Can {type} {model}.{field} in {query}" msgid "Can {type} {model}.{field} in {query}"
msgstr "" msgstr ""
#: apps/permission/models.py:80 apps/permission/models.py:273 #: apps/permission/models.py:84 apps/permission/models.py:277
#, python-brace-format #, python-brace-format
msgid "Can {type} {model} in {query}" msgid "Can {type} {model} in {query}"
msgstr "" msgstr ""
#: apps/permission/models.py:93 #: apps/permission/models.py:97
msgid "rank" msgid "rank"
msgstr "" msgstr ""
#: apps/permission/models.py:156 #: apps/permission/models.py:160
msgid "Specifying field applies only to view and change permission types." msgid "Specifying field applies only to view and change permission types."
msgstr "" msgstr ""
@ -892,19 +908,15 @@ msgstr ""
msgid "days" msgid "days"
msgstr "" msgstr ""
#: templates/member/club_info.html:43 #: templates/member/club_info.html:47
msgid "Add member" msgid "Add member"
msgstr "" 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" msgid "Edit"
msgstr "" msgstr ""
#: templates/member/club_info.html:45 #: templates/member/club_info.html:54 templates/member/profile_info.html:48
msgid "Add roles"
msgstr ""
#: templates/member/club_info.html:48 templates/member/profile_info.html:48
msgid "View Profile" msgid "View Profile"
msgstr "" msgstr ""

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\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é." msgstr "Vous ne pouvez pas inviter plus de 3 personnes à cette activité."
#: apps/activity/models.py:23 apps/activity/models.py:48 #: 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/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 #: templates/member/club_info.html:13 templates/member/profile_info.html:14
msgid "name" msgid "name"
msgstr "nom" msgstr "nom"
@ -64,7 +64,7 @@ msgid "activity types"
msgstr "types d'activité" msgstr "types d'activité"
#: apps/activity/models.py:53 apps/note/models/transactions.py:69 #: 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" msgid "description"
msgstr "description" msgstr "description"
@ -247,73 +247,77 @@ msgstr "Les logs ne peuvent pas être détruits."
msgid "member" msgid "member"
msgstr "adhérent" msgstr "adhérent"
#: apps/member/models.py:26 #: apps/member/models.py:28
msgid "phone number" msgid "phone number"
msgstr "numéro de téléphone" 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" msgid "section"
msgstr "section" msgstr "section"
#: apps/member/models.py:33 #: apps/member/models.py:35
msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\"" msgid "e.g. \"1A0\", \"9A♥\", \"SAPHIRE\""
msgstr "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" msgid "address"
msgstr "adresse" msgstr "adresse"
#: apps/member/models.py:45 #: apps/member/models.py:47
msgid "paid" msgid "paid"
msgstr "payé" 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" msgid "user profile"
msgstr "profil utilisateur" 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" msgid "email"
msgstr "courriel" msgstr "courriel"
#: apps/member/models.py:76 #: apps/member/models.py:78
msgid "parent club" msgid "parent club"
msgstr "club parent" msgstr "club parent"
#: apps/member/models.py:85 #: apps/member/models.py:87
msgid "require memberships" msgid "require memberships"
msgstr "nécessite des adhésions" 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." msgid "Uncheck if this club don't require memberships."
msgstr "Décochez si ce club n'utilise pas d'adhésions." msgstr "Décochez si ce club n'utilise pas d'adhésions."
#: apps/member/models.py:91 templates/member/club_info.html:31 #: apps/member/models.py:93 templates/member/club_info.html:31
msgid "membership fee" msgid "membership fee (paid students)"
msgstr "cotisation pour adhérer" 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" msgid "membership duration"
msgstr "durée de l'adhésion" 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)." 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)." 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" msgid "membership start"
msgstr "début de l'adhésion" 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." msgid "How long after January 1st the members can renew their membership."
msgstr "" msgstr ""
"Combien de temps après le 1er Janvier les adhérents peuvent renouveler leur " "Combien de temps après le 1er Janvier les adhérents peuvent renouveler leur "
"adhésion." "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" msgid "membership end"
msgstr "fin de l'adhésion" msgstr "fin de l'adhésion"
#: apps/member/models.py:114 #: apps/member/models.py:121
msgid "" msgid ""
"How long the membership can last after January 1st of the next year after " "How long the membership can last after January 1st of the next year after "
"members can renew their membership." "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 " "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." "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" msgid "club"
msgstr "club" msgstr "club"
#: apps/member/models.py:144 #: apps/member/models.py:152
msgid "clubs" msgid "clubs"
msgstr "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" msgid "role"
msgstr "rôle" msgstr "rôle"
#: apps/member/models.py:165 #: apps/member/models.py:173 apps/member/models.py:196
msgid "roles" msgid "roles"
msgstr "rôles" msgstr "rôles"
#: apps/member/models.py:191 #: apps/member/models.py:200
msgid "membership starts on" msgid "membership starts on"
msgstr "l'adhésion commence le" msgstr "l'adhésion commence le"
#: apps/member/models.py:195 #: apps/member/models.py:204
msgid "membership ends on" 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" msgid "fee"
msgstr "cotisation" 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" msgid "User is not a member of the parent club"
msgstr "L'utilisateur n'est pas membre du club parent" 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" msgid "membership"
msgstr "adhésion" msgstr "adhésion"
#: apps/member/models.py:225 #: apps/member/models.py:266
msgid "memberships" msgid "memberships"
msgstr "adhésions" 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" msgid "Update Profile"
msgstr "Modifier le profil" msgstr "Modifier le profil"
#: apps/member/views.py:90 #: apps/member/views.py:91
msgid "An alias with a similar name already exists." msgid "An alias with a similar name already exists."
msgstr "Un alias avec un nom similaire existe déjà." 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 #: apps/note/admin.py:120 apps/note/models/transactions.py:94
msgid "source" msgid "source"
msgstr "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 #: apps/note/models/transactions.py:53 apps/note/models/transactions.py:107
msgid "destination" msgid "destination"
msgstr "destination" msgstr "destination"
@ -471,7 +487,7 @@ msgstr "Alias invalide"
msgid "alias" msgid "alias"
msgstr "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 #: templates/member/profile_info.html:36
msgid "aliases" msgid "aliases"
msgstr "alias" msgstr "alias"
@ -533,45 +549,45 @@ msgstr "raison"
msgid "invalidity reason" msgid "invalidity reason"
msgstr "Motif d'invalidité" msgstr "Motif d'invalidité"
#: apps/note/models/transactions.py:146 #: apps/note/models/transactions.py:147
msgid "transaction" msgid "transaction"
msgstr "transaction" msgstr "transaction"
#: apps/note/models/transactions.py:147 #: apps/note/models/transactions.py:148
msgid "transactions" msgid "transactions"
msgstr "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:19
#: templates/note/transaction_form.html:140 #: templates/note/transaction_form.html:140
msgid "Transfer" msgid "Transfer"
msgstr "Virement" msgstr "Virement"
#: apps/note/models/transactions.py:221 #: apps/note/models/transactions.py:222
msgid "Template" msgid "Template"
msgstr "Bouton" msgstr "Bouton"
#: apps/note/models/transactions.py:236 #: apps/note/models/transactions.py:237
msgid "first_name" msgid "first_name"
msgstr "prénom" msgstr "prénom"
#: apps/note/models/transactions.py:241 #: apps/note/models/transactions.py:242
msgid "bank" msgid "bank"
msgstr "banque" 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" msgid "Credit"
msgstr "Crédit" 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" msgid "Debit"
msgstr "Débit" 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" msgid "membership transaction"
msgstr "transaction d'adhésion" msgstr "transaction d'adhésion"
#: apps/note/models/transactions.py:264 #: apps/note/models/transactions.py:265
msgid "membership transactions" msgid "membership transactions"
msgstr "transactions d'adhésion" msgstr "transactions d'adhésion"
@ -595,21 +611,21 @@ msgstr "Transférer de l'argent"
msgid "Consumptions" msgid "Consumptions"
msgstr "Consommations" 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 #, python-brace-format
msgid "Can {type} {model}.{field} in {query}" msgid "Can {type} {model}.{field} in {query}"
msgstr "" msgstr ""
#: apps/permission/models.py:80 apps/permission/models.py:273 #: apps/permission/models.py:84 apps/permission/models.py:277
#, python-brace-format #, python-brace-format
msgid "Can {type} {model} in {query}" msgid "Can {type} {model} in {query}"
msgstr "" msgstr ""
#: apps/permission/models.py:93 #: apps/permission/models.py:97
msgid "rank" msgid "rank"
msgstr "Rang" msgstr "Rang"
#: apps/permission/models.py:156 #: apps/permission/models.py:160
msgid "Specifying field applies only to view and change permission types." msgid "Specifying field applies only to view and change permission types."
msgstr "" msgstr ""
@ -895,19 +911,15 @@ msgstr "Club parent"
msgid "days" msgid "days"
msgstr "jours" msgstr "jours"
#: templates/member/club_info.html:43 #: templates/member/club_info.html:47
msgid "Add member" msgid "Add member"
msgstr "Ajouter un membre" 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" msgid "Edit"
msgstr "Éditer" msgstr "Éditer"
#: templates/member/club_info.html:45 #: templates/member/club_info.html:54 templates/member/profile_info.html:48
msgid "Add roles"
msgstr "Ajouter des rôles"
#: templates/member/club_info.html:48 templates/member/profile_info.html:48
msgid "View Profile" msgid "View Profile"
msgstr "Voir le profil" msgstr "Voir le profil"
@ -1217,5 +1229,8 @@ msgstr "Il n'y a pas de transaction associée à une remise ouverte."
msgid "Closed remittances" msgid "Closed remittances"
msgstr "Remises fermées" msgstr "Remises fermées"
#~ msgid "Add roles"
#~ msgstr "Ajouter des rôles"
#~ msgid "linked notes" #~ msgid "linked notes"
#~ msgstr "notes liées" #~ msgstr "notes liées"

View File

@ -15,14 +15,16 @@
require_memberships_obj = $("#id_require_memberships"); require_memberships_obj = $("#id_require_memberships");
if (!require_memberships_obj.is(":checked")) { 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_duration").toggle();
$("#div_id_membership_start").toggle(); $("#div_id_membership_start").toggle();
$("#div_id_membership_end").toggle(); $("#div_id_membership_end").toggle();
} }
require_memberships_obj.change(function () { 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_duration").toggle();
$("#div_id_membership_start").toggle(); $("#div_id_membership_start").toggle();
$("#div_id_membership_end").toggle(); $("#div_id_membership_end").toggle();

View File

@ -28,8 +28,11 @@
<dt class="col-xl-6">{% trans 'membership duration'|capfirst %}</dt> <dt class="col-xl-6">{% trans 'membership duration'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_duration }} {% trans "days" %}</dd> <dd class="col-xl-6">{{ club.membership_duration }} {% trans "days" %}</dd>
<dt class="col-xl-6">{% trans 'membership fee'|capfirst %}</dt> <dt class="col-xl-6">{% trans 'membership fee (paid students)'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_fee|pretty_money }}</dd> <dd class="col-xl-6">{{ club.membership_fee_paid|pretty_money }}</dd>
<dt class="col-xl-6">{% trans 'membership fee (unpaid students)'|capfirst %}</dt>
<dd class="col-xl-6">{{ club.membership_fee_unpaid|pretty_money }}</dd>
{% endif %} {% endif %}
<dt class="col-xl-6"><a href="{% url 'member:club_alias' club.pk %}">{% trans 'aliases'|capfirst %}</a></dt> <dt class="col-xl-6"><a href="{% url 'member:club_alias' club.pk %}">{% trans 'aliases'|capfirst %}</a></dt>