mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 18:08:21 +02:00
Compare commits
29 Commits
sheets
...
update_per
Author | SHA1 | Date | |
---|---|---|---|
03d2d5f03e | |||
d2057a9f45 | |||
6b1cd3ba7a | |||
9f114b8ca2 | |||
e0132b6dc8 | |||
31e67ae3f6 | |||
2839d3de1e | |||
30afa6da0a | |||
84fc77696f | |||
19fc620d1f | |||
6bceb394c5 | |||
62cf8f9d84 | |||
2dd1c3fb89 | |||
c8665c5798 | |||
e9f1b6f52d | |||
1d95ae4810 | |||
84b16ab603 | |||
6a1b51dbbf | |||
c441a43a8b | |||
87f3b51b04 | |||
0a853fd3e6 | |||
c429734810 | |||
5d759111b6 | |||
70baf7566c | |||
eb355f547c | |||
7068170f18 | |||
45ee9a8941 | |||
454ea19603 | |||
5a77a66391 |
@ -6,7 +6,7 @@
|
|||||||
"name": "Pot",
|
"name": "Pot",
|
||||||
"manage_entries": true,
|
"manage_entries": true,
|
||||||
"can_invite": true,
|
"can_invite": true,
|
||||||
"guest_entry_fee": 500
|
"guest_entry_fee": 1000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -28,5 +28,25 @@
|
|||||||
"can_invite": false,
|
"can_invite": false,
|
||||||
"guest_entry_fee": 0
|
"guest_entry_fee": 0
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "activity.activitytype",
|
||||||
|
"pk": 5,
|
||||||
|
"fields": {
|
||||||
|
"name": "Soir\u00e9e avec entrées",
|
||||||
|
"manage_entries": true,
|
||||||
|
"can_invite": false,
|
||||||
|
"guest_entry_fee": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "activity.activitytype",
|
||||||
|
"pk": 7,
|
||||||
|
"fields": {
|
||||||
|
"name": "Soir\u00e9e avec invitations",
|
||||||
|
"manage_entries": true,
|
||||||
|
"can_invite": true,
|
||||||
|
"guest_entry_fee": 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
5
apps/api/pagination.py
Normal file
5
apps/api/pagination.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from rest_framework.pagination import PageNumberPagination
|
||||||
|
|
||||||
|
class CustomPagination(PageNumberPagination):
|
||||||
|
page_size_query_param = 'page_size'
|
||||||
|
|
@ -221,7 +221,7 @@ function consume (source, source_alias, dest, quantity, amount, reason, type, ca
|
|||||||
.done(function () {
|
.done(function () {
|
||||||
if (!isNaN(source.balance)) {
|
if (!isNaN(source.balance)) {
|
||||||
const newBalance = source.balance - quantity * amount
|
const newBalance = source.balance - quantity * amount
|
||||||
if (newBalance <= -5000) {
|
if (newBalance <= -2000) {
|
||||||
addMsg(interpolate(gettext('Warning, the transaction from the note %s succeed, ' +
|
addMsg(interpolate(gettext('Warning, the transaction from the note %s succeed, ' +
|
||||||
'but the emitter note %s is very negative.'), [source_alias, source_alias]), 'danger', 30000)
|
'but the emitter note %s is very negative.'), [source_alias, source_alias]), 'danger', 30000)
|
||||||
} else if (newBalance < 0) {
|
} else if (newBalance < 0) {
|
||||||
|
@ -314,7 +314,7 @@ $('#btn_transfer').click(function () {
|
|||||||
|
|
||||||
if (!isNaN(source.note.balance)) {
|
if (!isNaN(source.note.balance)) {
|
||||||
const newBalance = source.note.balance - source.quantity * dest.quantity * amount
|
const newBalance = source.note.balance - source.quantity * dest.quantity * amount
|
||||||
if (newBalance <= -5000) {
|
if (newBalance <= -2000) {
|
||||||
addMsg(interpolate(gettext('Warning, the transaction of %s from the note %s to the note %s succeed, but the emitter note %s is very negative.'),
|
addMsg(interpolate(gettext('Warning, the transaction of %s from the note %s to the note %s succeed, but the emitter note %s is very negative.'),
|
||||||
[pretty_money(source.quantity * dest.quantity * amount), source.name, dest.name, source.name]), 'danger', 10000)
|
[pretty_money(source.quantity * dest.quantity * amount), source.name, dest.name, source.name]), 'danger', 10000)
|
||||||
reset()
|
reset()
|
||||||
|
File diff suppressed because it is too large
Load Diff
19
apps/permission/migrations/0002_club_not_required.py
Normal file
19
apps/permission/migrations/0002_club_not_required.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 2.2.28 on 2023-07-24 10:15
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('permission', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='role',
|
||||||
|
name='for_club',
|
||||||
|
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, to='member.Club', verbose_name='for club'),
|
||||||
|
),
|
||||||
|
]
|
@ -339,6 +339,7 @@ class Role(models.Model):
|
|||||||
"member.Club",
|
"member.Club",
|
||||||
verbose_name=_("for club"),
|
verbose_name=_("for club"),
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
default=None,
|
default=None,
|
||||||
)
|
)
|
||||||
|
@ -310,8 +310,8 @@ class SogeCredit(models.Model):
|
|||||||
amount = sum(transaction.total for transaction in self.transactions.all())
|
amount = sum(transaction.total for transaction in self.transactions.all())
|
||||||
if 'wei' in settings.INSTALLED_APPS:
|
if 'wei' in settings.INSTALLED_APPS:
|
||||||
from wei.models import WEIMembership
|
from wei.models import WEIMembership
|
||||||
if not WEIMembership.objects.filter(club__weiclub__year=datetime.date.today().year, user=self.user)\
|
if not WEIMembership.objects\
|
||||||
.exists():
|
.filter(club__weiclub__year=self.credit_transaction.created_at.year, user=self.user).exists():
|
||||||
# 80 € for people that don't go to WEI
|
# 80 € for people that don't go to WEI
|
||||||
amount += 8000
|
amount += 8000
|
||||||
return amount
|
return amount
|
||||||
@ -329,17 +329,18 @@ class SogeCredit(models.Model):
|
|||||||
bde_qs = Membership.objects.filter(user=self.user, club=bde, date_start__gte=bde.membership_start)
|
bde_qs = Membership.objects.filter(user=self.user, club=bde, date_start__gte=bde.membership_start)
|
||||||
kfet_qs = Membership.objects.filter(user=self.user, club=kfet, date_start__gte=kfet.membership_start)
|
kfet_qs = Membership.objects.filter(user=self.user, club=kfet, date_start__gte=kfet.membership_start)
|
||||||
|
|
||||||
if bde_qs.exists():
|
## Soge do not pay BDE and kfet memberships this year (2022-2023)
|
||||||
m = bde_qs.get()
|
# if bde_qs.exists():
|
||||||
if MembershipTransaction.objects.filter(membership=m).exists(): # non-free membership
|
# m = bde_qs.get()
|
||||||
if m.transaction not in self.transactions.all():
|
# if MembershipTransaction.objects.filter(membership=m).exists(): # non-free membership
|
||||||
self.transactions.add(m.transaction)
|
# if m.transaction not in self.transactions.all():
|
||||||
|
# self.transactions.add(m.transaction)
|
||||||
if kfet_qs.exists():
|
#
|
||||||
m = kfet_qs.get()
|
# if kfet_qs.exists():
|
||||||
if MembershipTransaction.objects.filter(membership=m).exists(): # non-free membership
|
# m = kfet_qs.get()
|
||||||
if m.transaction not in self.transactions.all():
|
# if MembershipTransaction.objects.filter(membership=m).exists(): # non-free membership
|
||||||
self.transactions.add(m.transaction)
|
# if m.transaction not in self.transactions.all():
|
||||||
|
# self.transactions.add(m.transaction)
|
||||||
|
|
||||||
if 'wei' in settings.INSTALLED_APPS:
|
if 'wei' in settings.INSTALLED_APPS:
|
||||||
from wei.models import WEIClub
|
from wei.models import WEIClub
|
||||||
|
@ -108,7 +108,7 @@ class InvoiceListView(LoginRequiredMixin, SingleTableView):
|
|||||||
name="",
|
name="",
|
||||||
address="",
|
address="",
|
||||||
)
|
)
|
||||||
if not PermissionBackend.check_perm(self.request, "treasury.add_invoice", sample_invoice):
|
if not PermissionBackend.check_perm(self.request, "treasury.view_invoice", sample_invoice):
|
||||||
raise PermissionDenied(_("You are not able to see the treasury interface."))
|
raise PermissionDenied(_("You are not able to see the treasury interface."))
|
||||||
return super().dispatch(request, *args, **kwargs)
|
return super().dispatch(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@ -14,14 +14,17 @@ from .base import WEISurvey, WEISurveyInformation, WEISurveyAlgorithm, WEIBusInf
|
|||||||
from ...models import WEIMembership
|
from ...models import WEIMembership
|
||||||
|
|
||||||
WORDS = [
|
WORDS = [
|
||||||
'13 organisé', '3ième mi temps', 'Années 2000', 'Apéro', 'BBQ', 'BP', 'Beauf', 'Binge drinking', 'Bon enfant',
|
'ABBA', 'After', 'Alcoolique anonyme', 'Ambiance festive', 'Années 2000', 'Apéro', 'Art',
|
||||||
'Cartouche', 'Catacombes', 'Chansons paillardes', 'Chansons populaires', 'Chanteur', 'Chartreuse', 'Chill',
|
'Baby foot billard biere pong', 'BBQ', 'Before', 'Bière pong', 'Bon enfant', 'Calme', 'Canapé',
|
||||||
'Core', 'DJ', 'Dancefloor', 'Danse', 'David Guetta', 'Disco', 'Eau de vie', 'Électro', 'Escalade', 'Familial',
|
'Chanson paillarde', 'Chanson populaire', 'Chartreuse', 'Cheerleader', 'Chill', 'Choré',
|
||||||
'Fanfare', 'Fracassage', 'Féria', 'Hard rock', 'Hoeggarden', 'House', 'Huit-six', 'IPA', 'Inclusif', 'Inferno',
|
'Cinéma', 'Cocktail', 'Comédie musicle', 'Commercial', 'Copaing', 'Danse', 'Dancefloor',
|
||||||
'Introverti', 'Jager bomb', 'Jazz', 'Jeux d\'alcool', 'Jeux de rôles', 'Jeux vidéo', 'Jul', 'Jus de fruit',
|
'Electro', 'Fanfare', 'Gin tonic', 'Inclusif', 'Jazz', "Jeux d'alcool", 'Jeux de carte',
|
||||||
'Karaoké', 'LGBTQI+', 'Lady Gaga', 'Loup garou', 'Morning beer', 'Métal', 'Nuit blanche', 'Ovalie', 'Psychedelic',
|
'Jeux de rôle', 'Jeux de société', 'JUL', 'Jus de fruit', 'Kfet', 'Kleptomanie assurée',
|
||||||
'Pétanque', 'Rave', 'Reggae', 'Rhum', 'Ricard', 'Rock', 'Rosé', 'Rétro', 'Séducteur', 'Techno', 'Thérapie taxi',
|
'LGBTQ+', 'Livre', 'Morning beer', 'Musique', 'NAPS', 'Paillettes', 'Pastis', 'Paté Hénaff',
|
||||||
'Théâtre', 'Trap', 'Turn up', 'Underground', 'Volley', 'Wati B', 'Zinédine Zidane',
|
'Peluche', 'Pena baiona', "Peu d'alcool", 'Pilier de bar', 'PMU', 'Poulpe', 'Punch', 'Rap',
|
||||||
|
'Réveil', 'Rock', 'Rugby', 'Sandwich', 'Serge', 'Shot', 'Sociable', 'Spectacle', 'Techno',
|
||||||
|
'Techno house', 'Thérapie Taxi', 'Tradition kchanaises', 'Troisième mi-temps', 'Turn up',
|
||||||
|
'Vodka', 'Vodka pomme', 'Volley', 'Vomi stratégique'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,13 +118,13 @@ Exemples
|
|||||||
{"F": [
|
{"F": [
|
||||||
"ADD",
|
"ADD",
|
||||||
["F", "source__balance"],
|
["F", "source__balance"],
|
||||||
5000]
|
2000]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
| si la destination est la note du club dont on est membre et si le montant est inférieur au solde de la source + 50 €,
|
| si la destination est la note du club dont on est membre et si le montant est inférieur au solde de la source + 20 €,
|
||||||
autrement dit le solde final est au-dessus de -50 €.
|
autrement dit le solde final est au-dessus de -20 €.
|
||||||
|
|
||||||
|
|
||||||
Masques de permissions
|
Masques de permissions
|
||||||
|
@ -83,13 +83,6 @@ Je suis trésorier d'un club, qu'ai-je le droit de faire ?
|
|||||||
bien sûr permis pour faciliter des transferts. Tout abus de droits constaté
|
bien sûr permis pour faciliter des transferts. Tout abus de droits constaté
|
||||||
pourra mener à des sanctions prises par le bureau du BDE.
|
pourra mener à des sanctions prises par le bureau du BDE.
|
||||||
|
|
||||||
.. warning::
|
|
||||||
Une fonctionnalité pour permettre de gérer plus proprement les remboursements
|
|
||||||
entre amis est en cours de développement. Temporairement et pour des raisons
|
|
||||||
de confort, les trésoriers de clubs ont le droit de prélever n'importe quelle
|
|
||||||
adhérente vers n'importe quelle autre note adhérente, tant que la source ne
|
|
||||||
descend pas sous ``- 50 €``. Ces droits seront retirés d'ici quelques semaines.
|
|
||||||
|
|
||||||
|
|
||||||
Je suis trésorier d'un club, je n'arrive pas à voir le solde du club / faire des transactions
|
Je suis trésorier d'un club, je n'arrive pas à voir le solde du club / faire des transactions
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
@ -252,7 +252,7 @@ REST_FRAMEWORK = {
|
|||||||
'rest_framework.authentication.TokenAuthentication',
|
'rest_framework.authentication.TokenAuthentication',
|
||||||
'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
|
'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
|
||||||
],
|
],
|
||||||
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
|
'DEFAULT_PAGINATION_CLASS': 'apps.api.pagination.CustomPagination',
|
||||||
'PAGE_SIZE': 20,
|
'PAGE_SIZE': 20,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ function displayStyle (note) {
|
|||||||
if (!note) { return '' }
|
if (!note) { return '' }
|
||||||
const balance = note.balance
|
const balance = note.balance
|
||||||
var css = ''
|
var css = ''
|
||||||
if (balance < -5000) { css += ' text-danger bg-dark' }
|
if (balance < -2000) { css += ' text-danger bg-dark' }
|
||||||
else if (balance < -1000) { css += ' text-danger' }
|
else if (balance < -1000) { css += ' text-danger' }
|
||||||
else if (balance < 0) { css += ' text-warning' }
|
else if (balance < 0) { css += ' text-warning' }
|
||||||
if (!note.email_confirmed) { css += ' bg-primary' }
|
if (!note.email_confirmed) { css += ' bg-primary' }
|
||||||
|
@ -23,7 +23,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form|crispy }}
|
{{ form|crispy }}
|
||||||
{{ profile_form|crispy }}
|
{{ profile_form|crispy }}
|
||||||
{{ soge_form|crispy }}
|
{% comment "Soge not for membership (only WEI)" %} {{ soge_form|crispy }} {% endcomment %}
|
||||||
<button class="btn btn-success" type="submit">
|
<button class="btn btn-success" type="submit">
|
||||||
{% trans "Sign up" %}
|
{% trans "Sign up" %}
|
||||||
</button>
|
</button>
|
||||||
|
Reference in New Issue
Block a user