Add real BD fee
This commit is contained in:
parent
8a03defc37
commit
121c49a5b6
11 changed files with 188 additions and 28 deletions
|
|
@ -91,7 +91,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||
}).done(function () {
|
||||
if (target.hasClass("table-info"))
|
||||
addMsg(
|
||||
"{% trans "Entry done, but caution: the user is not a Kfet member." %}",
|
||||
"{% trans "Entry done, but caution: the user is not a member." %}",
|
||||
"warning", 10000);
|
||||
else
|
||||
addMsg("Entry made!", "success", 4000);
|
||||
|
|
@ -126,7 +126,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||
}).done(function () {
|
||||
if (target.hasClass("table-info"))
|
||||
addMsg(
|
||||
"{% trans "Entry done, but caution: the user is not a Kfet member." %}",
|
||||
"{% trans "Entry done, but caution: the user is not a member." %}",
|
||||
"warning", 10000);
|
||||
else
|
||||
addMsg("{% trans "Entry done!" %}", "success", 4000);
|
||||
|
|
|
|||
42
apps/member/migrations/0002_auto_20220817_2253.py
Normal file
42
apps/member/migrations/0002_auto_20220817_2253.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# Generated by Django 2.2.28 on 2022-08-17 20:53
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('member', '0001_initial'),
|
||||
('permission', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='membership',
|
||||
name='roles',
|
||||
field=models.ManyToManyField(related_name='memberships', to='permission.Role', verbose_name='roles'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='membership',
|
||||
name='user',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='memberships', to=settings.AUTH_USER_MODEL, verbose_name='user'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='club',
|
||||
name='parent_club',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='member.Club', verbose_name='parent club'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='profile',
|
||||
index=models.Index(fields=['user'], name='member_prof_user_id_30c316_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='membership',
|
||||
index=models.Index(fields=['user'], name='member_memb_user_id_945dbc_idx'),
|
||||
),
|
||||
]
|
||||
97
apps/member/migrations/0003_create_initial_club.py
Normal file
97
apps/member/migrations/0003_create_initial_club.py
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
"""Migration member default BDE BDA"""
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def create_initial_club(apps, schema_editor):
|
||||
"""
|
||||
The clubs BDE BDA BDS are pre-injected.
|
||||
"""
|
||||
Club = apps.get_model("member", "club")
|
||||
NoteClub = apps.get_model("note", "noteclub")
|
||||
Alias = apps.get_model("note", "alias")
|
||||
ContentType = apps.get_model('contenttypes', 'ContentType')
|
||||
polymorphic_ctype_id = ContentType.objects.get_for_model(NoteClub).id
|
||||
|
||||
Club.objects.get_or_create(
|
||||
id=1,
|
||||
name="BDE",
|
||||
email="tresorerie.bde@example.com",
|
||||
require_memberships=True,
|
||||
membership_fee_paid=3500,
|
||||
membership_fee_unpaid=2800,
|
||||
membership_duration=396,
|
||||
membership_start="2022-08-01",
|
||||
membership_end="2023-09-30",
|
||||
)
|
||||
|
||||
Club.objects.get_or_create(
|
||||
id=2,
|
||||
name="BDA",
|
||||
email="tresorerie.bda@example.com",
|
||||
require_memberships=True,
|
||||
membership_fee_paid=2500,
|
||||
membership_fee_unpaid=1700,
|
||||
membership_duration=396,
|
||||
membership_start="2022-08-01",
|
||||
membership_end="2023-09-30",
|
||||
)
|
||||
|
||||
Club.objects.get_or_create(
|
||||
id=3,
|
||||
name="BDS",
|
||||
email="tresorerie.bds@example.com",
|
||||
require_memberships=True,
|
||||
membership_fee_paid=3000,
|
||||
membership_fee_unpaid=2300,
|
||||
membership_duration=396,
|
||||
membership_start="2022-08-01",
|
||||
membership_end="2023-09-30",
|
||||
)
|
||||
|
||||
|
||||
NoteClub.objects.get_or_create(
|
||||
id=5,
|
||||
club_id=1,
|
||||
polymorphic_ctype_id=polymorphic_ctype_id,
|
||||
)
|
||||
NoteClub.objects.get_or_create(
|
||||
id=6,
|
||||
club_id=2,
|
||||
polymorphic_ctype_id=polymorphic_ctype_id,
|
||||
)
|
||||
NoteClub.objects.get_or_create(
|
||||
id=7,
|
||||
club_id=3,
|
||||
polymorphic_ctype_id=polymorphic_ctype_id,
|
||||
)
|
||||
|
||||
Alias.objects.get_or_create(
|
||||
id=5,
|
||||
note_id=5,
|
||||
name="BDE",
|
||||
normalized_name="bde",
|
||||
)
|
||||
Alias.objects.get_or_create(
|
||||
id=6,
|
||||
note_id=6,
|
||||
name="BDA",
|
||||
normalized_name="bda",
|
||||
)
|
||||
Alias.objects.get_or_create(
|
||||
id=7,
|
||||
note_id=7,
|
||||
name="BDS",
|
||||
normalized_name="bds",
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('member', '0002_auto_20220817_2253'),
|
||||
('note', '0002_special_note'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(create_initial_club),
|
||||
]
|
||||
|
|
@ -153,7 +153,7 @@ class Profile(models.Model):
|
|||
return str(self.user)
|
||||
|
||||
def send_email_validation_link(self):
|
||||
subject = "[Note Kfet] " + str(_("Activate your Note Kfet account"))
|
||||
subject = "[Note Ker Lann] " + str(_("Activate your Note Ker Lann account"))
|
||||
token = email_validation_token.make_token(self.user)
|
||||
uid = urlsafe_base64_encode(force_bytes(self.user_id))
|
||||
message = loader.render_to_string('registration/mails/email_validation_email.txt',
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||
<div class="alert alert-info">
|
||||
<h4>À quoi sert un jeton d'authentification ?</h4>
|
||||
|
||||
Un jeton vous permet de vous connecter à <a href="/api/">l'API de la Note Kfet</a> via votre propre compte
|
||||
Un jeton vous permet de vous connecter à <a href="/api/">l'API de la Note Ker Lann</a> via votre propre compte
|
||||
depuis un client externe.<br />
|
||||
Il suffit pour cela d'ajouter en en-tête de vos requêtes <code>Authorization: Token <TOKEN></code>
|
||||
pour pouvoir vous identifier.<br /><br />
|
||||
|
|
@ -55,10 +55,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||
<div class="card-header">
|
||||
<div class="alert alert-info">
|
||||
<p>
|
||||
La Note Kfet implémente également le protocole <a href="https://oauth.net/2/">OAuth2</a>, afin de
|
||||
La Note Ker Lann implémente également le protocole <a href="https://oauth.net/2/">OAuth2</a>, afin de
|
||||
permettre à des applications tierces d'interagir avec la Note en récoltant des informations
|
||||
(de connexion par exemple) voir en permettant des modifications à distance, par exemple lorsqu'il
|
||||
s'agit d'avoir un site marchand sur lequel faire des transactions via la Note Kfet.
|
||||
s'agit d'avoir un site marchand sur lequel faire des transactions via la Note Ker Lann.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ class NoteClub(Note):
|
|||
def send_mail_negative_balance(self):
|
||||
plain_text = render_to_string("note/mails/negative_balance.txt", dict(note=self))
|
||||
html = render_to_string("note/mails/negative_balance.html", dict(note=self))
|
||||
send_mail("[Note Kfet] Passage en négatif (club {})".format(self.club.name), plain_text,
|
||||
send_mail("[Note Ker Lann] Passage en négatif (club {})".format(self.club.name), plain_text,
|
||||
settings.DEFAULT_FROM_EMAIL, [self.club.email], html_message=html)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1979,7 +1979,8 @@
|
|||
59,
|
||||
60,
|
||||
61,
|
||||
62
|
||||
62,
|
||||
169
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
@ -1998,9 +1999,21 @@
|
|||
60,
|
||||
61,
|
||||
62,
|
||||
63,
|
||||
64,
|
||||
65,
|
||||
66,
|
||||
67,
|
||||
68,
|
||||
69,
|
||||
151,
|
||||
166,
|
||||
167,
|
||||
168,
|
||||
172,
|
||||
173,
|
||||
174,
|
||||
175,
|
||||
182,
|
||||
184,
|
||||
185
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class InvoiceForm(forms.ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = Invoice
|
||||
exclude = ('bde', 'date', 'tex', )
|
||||
exclude = ('date', 'tex', )
|
||||
|
||||
|
||||
class ProductForm(forms.ModelForm):
|
||||
|
|
|
|||
18
apps/treasury/migrations/0002_auto_20220824_1919.py
Normal file
18
apps/treasury/migrations/0002_auto_20220824_1919.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.28 on 2022-08-24 17:19
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('treasury', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='invoice',
|
||||
name='bde',
|
||||
field=models.CharField(choices=[('BDE', 'BDE'), ('BDA', 'BDA'), ('BDS', 'BDS')], default='BDE', max_length=32, verbose_name='BD?'),
|
||||
),
|
||||
]
|
||||
|
|
@ -31,8 +31,10 @@ class Invoice(models.Model):
|
|||
default='BDE',
|
||||
choices=(
|
||||
('BDE', 'BDE'),
|
||||
('BDA', 'BDA'),
|
||||
('BDS', 'BDS'),
|
||||
),
|
||||
verbose_name=_("BDE"),
|
||||
verbose_name=_("BD?"),
|
||||
)
|
||||
|
||||
object = models.CharField(
|
||||
|
|
@ -89,10 +91,10 @@ class Invoice(models.Model):
|
|||
|
||||
products = self.products.all()
|
||||
|
||||
self.place = "Gif-sur-Yvette"
|
||||
self.my_name = "BDE ENS Cachan"
|
||||
self.my_address_street = "4 avenue des Sciences"
|
||||
self.my_city = "91190 Gif-sur-Yvette"
|
||||
self.place = "Bruz"
|
||||
self.my_name = f"{self.bde} ENS Rennes"
|
||||
self.my_address_street = "14 avenue Robert Schumann"
|
||||
self.my_city = "35170 Bruz"
|
||||
self.bank_code = 30003
|
||||
self.desk_code = 3894
|
||||
self.account_number = 37280662
|
||||
|
|
|
|||
|
|
@ -47,18 +47,6 @@
|
|||
{% endfor %}
|
||||
}
|
||||
|
||||
% Logo du BDE
|
||||
\AddToShipoutPicture*{
|
||||
\put(0,0){
|
||||
\parbox[b][\paperheight]{\paperwidth}{%
|
||||
\vfill
|
||||
\centering
|
||||
\includegraphics[width=\textwidth]{../../apps/treasury/static/img/{{ obj.bde }}_bg.jpg}
|
||||
\vfill
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
|
||||
% Infos Association
|
||||
|
|
@ -105,8 +93,8 @@
|
|||
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
\cfoot{
|
||||
\small{\MonNom ~--~ \MonAdresseRue ~ \MonAdresseVille ~--~ Téléphone : +33(0)6 89 88 56 50\newline
|
||||
Site web : bde.ens-cachan.fr ~--~ E-mail : tresorerie.bde@lists.crans.org \newline Numéro SIRET : 399 485 838 00011
|
||||
\small{\MonNom ~--~ \MonAdresseRue ~ \MonAdresseVille ~--~ Téléphone : +33(0)6 00 00 00 00\newline
|
||||
Site web : TODO ~--~ E-mail : TODO \newline Numéro SIRET : 000 000 000 00000
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue