diff --git a/accounting/__init__.py b/accounting/__init__.py deleted file mode 100644 index f4445e69..00000000 --- a/accounting/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright 2023 © AE UTBM -# ae@utbm.fr / ae.info@utbm.fr -# -# This file is part of the website of the UTBM Student Association (AE UTBM), -# https://ae.utbm.fr. -# -# You can find the source code of the website at https://github.com/ae-utbm/sith -# -# LICENSED UNDER THE GNU GENERAL PUBLIC LICENSE VERSION 3 (GPLv3) -# SEE : https://raw.githubusercontent.com/ae-utbm/sith/master/LICENSE -# OR WITHIN THE LOCAL FILE "LICENSE" -# -# diff --git a/accounting/migrations/0001_initial.py b/accounting/migrations/0001_initial.py deleted file mode 100644 index 29ce0739..00000000 --- a/accounting/migrations/0001_initial.py +++ /dev/null @@ -1,280 +0,0 @@ -from __future__ import unicode_literals - -import django.core.validators -import django.db.models.deletion -from django.db import migrations, models - -import counter.fields - - -class Migration(migrations.Migration): - dependencies = [] - - operations = [ - migrations.CreateModel( - name="AccountingType", - fields=[ - ( - "id", - models.AutoField( - primary_key=True, - serialize=False, - verbose_name="ID", - auto_created=True, - ), - ), - ( - "code", - models.CharField( - max_length=16, - verbose_name="code", - validators=[ - django.core.validators.RegexValidator( - "^[0-9]*$", - "An accounting type code contains only numbers", - ) - ], - ), - ), - ("label", models.CharField(max_length=128, verbose_name="label")), - ( - "movement_type", - models.CharField( - choices=[ - ("CREDIT", "Credit"), - ("DEBIT", "Debit"), - ("NEUTRAL", "Neutral"), - ], - max_length=12, - verbose_name="movement type", - ), - ), - ], - options={ - "verbose_name": "accounting type", - "ordering": ["movement_type", "code"], - }, - ), - migrations.CreateModel( - name="BankAccount", - fields=[ - ( - "id", - models.AutoField( - primary_key=True, - serialize=False, - verbose_name="ID", - auto_created=True, - ), - ), - ("name", models.CharField(max_length=30, verbose_name="name")), - ( - "iban", - models.CharField(max_length=255, blank=True, verbose_name="iban"), - ), - ( - "number", - models.CharField( - max_length=255, blank=True, verbose_name="account number" - ), - ), - ], - options={"verbose_name": "Bank account", "ordering": ["club", "name"]}, - ), - migrations.CreateModel( - name="ClubAccount", - fields=[ - ( - "id", - models.AutoField( - primary_key=True, - serialize=False, - verbose_name="ID", - auto_created=True, - ), - ), - ("name", models.CharField(max_length=30, verbose_name="name")), - ], - options={ - "verbose_name": "Club account", - "ordering": ["bank_account", "name"], - }, - ), - migrations.CreateModel( - name="Company", - fields=[ - ( - "id", - models.AutoField( - primary_key=True, - serialize=False, - verbose_name="ID", - auto_created=True, - ), - ), - ("name", models.CharField(max_length=60, verbose_name="name")), - ], - options={"verbose_name": "company"}, - ), - migrations.CreateModel( - name="GeneralJournal", - fields=[ - ( - "id", - models.AutoField( - primary_key=True, - serialize=False, - verbose_name="ID", - auto_created=True, - ), - ), - ("start_date", models.DateField(verbose_name="start date")), - ( - "end_date", - models.DateField( - null=True, verbose_name="end date", default=None, blank=True - ), - ), - ("name", models.CharField(max_length=40, verbose_name="name")), - ( - "closed", - models.BooleanField(verbose_name="is closed", default=False), - ), - ( - "amount", - counter.fields.CurrencyField( - decimal_places=2, - default=0, - verbose_name="amount", - max_digits=12, - ), - ), - ( - "effective_amount", - counter.fields.CurrencyField( - decimal_places=2, - default=0, - verbose_name="effective_amount", - max_digits=12, - ), - ), - ], - options={"verbose_name": "General journal", "ordering": ["-start_date"]}, - ), - migrations.CreateModel( - name="Operation", - fields=[ - ( - "id", - models.AutoField( - primary_key=True, - serialize=False, - verbose_name="ID", - auto_created=True, - ), - ), - ("number", models.IntegerField(verbose_name="number")), - ( - "amount", - counter.fields.CurrencyField( - decimal_places=2, max_digits=12, verbose_name="amount" - ), - ), - ("date", models.DateField(verbose_name="date")), - ("remark", models.CharField(max_length=128, verbose_name="comment")), - ( - "mode", - models.CharField( - choices=[ - ("CHECK", "Check"), - ("CASH", "Cash"), - ("TRANSFERT", "Transfert"), - ("CARD", "Credit card"), - ], - max_length=255, - verbose_name="payment method", - ), - ), - ( - "cheque_number", - models.CharField( - max_length=32, - null=True, - verbose_name="cheque number", - default="", - blank=True, - ), - ), - ("done", models.BooleanField(verbose_name="is done", default=False)), - ( - "target_type", - models.CharField( - choices=[ - ("USER", "User"), - ("CLUB", "Club"), - ("ACCOUNT", "Account"), - ("COMPANY", "Company"), - ("OTHER", "Other"), - ], - max_length=10, - verbose_name="target type", - ), - ), - ( - "target_id", - models.IntegerField( - null=True, verbose_name="target id", blank=True - ), - ), - ( - "target_label", - models.CharField( - max_length=32, - blank=True, - verbose_name="target label", - default="", - ), - ), - ( - "accounting_type", - models.ForeignKey( - null=True, - related_name="operations", - verbose_name="accounting type", - to="accounting.AccountingType", - blank=True, - on_delete=django.db.models.deletion.CASCADE, - ), - ), - ], - options={"ordering": ["-number"]}, - ), - migrations.CreateModel( - name="SimplifiedAccountingType", - fields=[ - ( - "id", - models.AutoField( - primary_key=True, - serialize=False, - verbose_name="ID", - auto_created=True, - ), - ), - ("label", models.CharField(max_length=128, verbose_name="label")), - ( - "accounting_type", - models.ForeignKey( - verbose_name="simplified accounting types", - to="accounting.AccountingType", - related_name="simplified_types", - on_delete=django.db.models.deletion.CASCADE, - ), - ), - ], - options={ - "verbose_name": "simplified type", - "ordering": ["accounting_type__movement_type", "accounting_type__code"], - }, - ), - ] diff --git a/accounting/migrations/0002_auto_20160824_2152.py b/accounting/migrations/0002_auto_20160824_2152.py deleted file mode 100644 index adfc0225..00000000 --- a/accounting/migrations/0002_auto_20160824_2152.py +++ /dev/null @@ -1,105 +0,0 @@ -from __future__ import unicode_literals - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("club", "0001_initial"), - ("accounting", "0001_initial"), - ("core", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="operation", - name="invoice", - field=models.ForeignKey( - null=True, - related_name="operations", - verbose_name="invoice", - to="core.SithFile", - blank=True, - on_delete=django.db.models.deletion.CASCADE, - ), - ), - migrations.AddField( - model_name="operation", - name="journal", - field=models.ForeignKey( - verbose_name="journal", - to="accounting.GeneralJournal", - related_name="operations", - on_delete=django.db.models.deletion.CASCADE, - ), - ), - migrations.AddField( - model_name="operation", - name="linked_operation", - field=models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, - blank=True, - to="accounting.Operation", - null=True, - related_name="operation_linked_to", - verbose_name="linked operation", - default=None, - ), - ), - migrations.AddField( - model_name="operation", - name="simpleaccounting_type", - field=models.ForeignKey( - null=True, - related_name="operations", - verbose_name="simple type", - to="accounting.SimplifiedAccountingType", - blank=True, - on_delete=django.db.models.deletion.CASCADE, - ), - ), - migrations.AddField( - model_name="generaljournal", - name="club_account", - field=models.ForeignKey( - verbose_name="club account", - to="accounting.ClubAccount", - related_name="journals", - on_delete=django.db.models.deletion.CASCADE, - ), - ), - migrations.AddField( - model_name="clubaccount", - name="bank_account", - field=models.ForeignKey( - verbose_name="bank account", - to="accounting.BankAccount", - related_name="club_accounts", - on_delete=django.db.models.deletion.CASCADE, - ), - ), - migrations.AddField( - model_name="clubaccount", - name="club", - field=models.ForeignKey( - verbose_name="club", - to="club.Club", - related_name="club_account", - on_delete=django.db.models.deletion.CASCADE, - ), - ), - migrations.AddField( - model_name="bankaccount", - name="club", - field=models.ForeignKey( - verbose_name="club", - to="club.Club", - related_name="bank_accounts", - on_delete=django.db.models.deletion.CASCADE, - ), - ), - migrations.AlterUniqueTogether( - name="operation", unique_together={("number", "journal")} - ), - ] diff --git a/accounting/migrations/0003_auto_20160824_2203.py b/accounting/migrations/0003_auto_20160824_2203.py deleted file mode 100644 index 7fa3910a..00000000 --- a/accounting/migrations/0003_auto_20160824_2203.py +++ /dev/null @@ -1,48 +0,0 @@ -from __future__ import unicode_literals - -import phonenumber_field.modelfields -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [("accounting", "0002_auto_20160824_2152")] - - operations = [ - migrations.AddField( - model_name="company", - name="city", - field=models.CharField(blank=True, verbose_name="city", max_length=60), - ), - migrations.AddField( - model_name="company", - name="country", - field=models.CharField(blank=True, verbose_name="country", max_length=32), - ), - migrations.AddField( - model_name="company", - name="email", - field=models.EmailField(blank=True, verbose_name="email", max_length=254), - ), - migrations.AddField( - model_name="company", - name="phone", - field=phonenumber_field.modelfields.PhoneNumberField( - blank=True, verbose_name="phone", max_length=128 - ), - ), - migrations.AddField( - model_name="company", - name="postcode", - field=models.CharField(blank=True, verbose_name="postcode", max_length=10), - ), - migrations.AddField( - model_name="company", - name="street", - field=models.CharField(blank=True, verbose_name="street", max_length=60), - ), - migrations.AddField( - model_name="company", - name="website", - field=models.CharField(blank=True, verbose_name="website", max_length=64), - ), - ] diff --git a/accounting/migrations/0004_auto_20161005_1505.py b/accounting/migrations/0004_auto_20161005_1505.py deleted file mode 100644 index fe8fd3c4..00000000 --- a/accounting/migrations/0004_auto_20161005_1505.py +++ /dev/null @@ -1,50 +0,0 @@ -from __future__ import unicode_literals - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [("accounting", "0003_auto_20160824_2203")] - - operations = [ - migrations.CreateModel( - name="Label", - fields=[ - ( - "id", - models.AutoField( - verbose_name="ID", - primary_key=True, - auto_created=True, - serialize=False, - ), - ), - ("name", models.CharField(max_length=64, verbose_name="label")), - ( - "club_account", - models.ForeignKey( - related_name="labels", - verbose_name="club account", - to="accounting.ClubAccount", - on_delete=django.db.models.deletion.CASCADE, - ), - ), - ], - ), - migrations.AddField( - model_name="operation", - name="label", - field=models.ForeignKey( - on_delete=django.db.models.deletion.SET_NULL, - related_name="operations", - null=True, - blank=True, - verbose_name="label", - to="accounting.Label", - ), - ), - migrations.AlterUniqueTogether( - name="label", unique_together={("name", "club_account")} - ), - ] diff --git a/accounting/migrations/0005_auto_20170324_0917.py b/accounting/migrations/0005_auto_20170324_0917.py deleted file mode 100644 index 3f640fd0..00000000 --- a/accounting/migrations/0005_auto_20170324_0917.py +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [("accounting", "0004_auto_20161005_1505")] - - operations = [ - migrations.AlterField( - model_name="operation", - name="remark", - field=models.CharField( - null=True, max_length=128, blank=True, verbose_name="comment" - ), - ) - ] diff --git a/accounting/migrations/0006_remove_all_models.py b/accounting/migrations/0006_remove_all_models.py deleted file mode 100644 index 96add19c..00000000 --- a/accounting/migrations/0006_remove_all_models.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 4.2.20 on 2025-03-14 16:06 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [("accounting", "0005_auto_20170324_0917")] - - operations = [ - migrations.RemoveField(model_name="bankaccount", name="club"), - migrations.RemoveField(model_name="clubaccount", name="bank_account"), - migrations.RemoveField(model_name="clubaccount", name="club"), - migrations.DeleteModel(name="Company"), - migrations.RemoveField(model_name="generaljournal", name="club_account"), - migrations.AlterUniqueTogether(name="label", unique_together=None), - migrations.RemoveField(model_name="label", name="club_account"), - migrations.AlterUniqueTogether(name="operation", unique_together=None), - migrations.RemoveField(model_name="operation", name="accounting_type"), - migrations.RemoveField(model_name="operation", name="invoice"), - migrations.RemoveField(model_name="operation", name="journal"), - migrations.RemoveField(model_name="operation", name="label"), - migrations.RemoveField(model_name="operation", name="linked_operation"), - migrations.RemoveField(model_name="operation", name="simpleaccounting_type"), - migrations.RemoveField( - model_name="simplifiedaccountingtype", name="accounting_type" - ), - migrations.DeleteModel(name="AccountingType"), - migrations.DeleteModel(name="BankAccount"), - migrations.DeleteModel(name="ClubAccount"), - migrations.DeleteModel(name="GeneralJournal"), - migrations.DeleteModel(name="Label"), - migrations.DeleteModel(name="Operation"), - migrations.DeleteModel(name="SimplifiedAccountingType"), - ] diff --git a/accounting/migrations/__init__.py b/accounting/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/accounting/models.py b/accounting/models.py deleted file mode 100644 index f4445e69..00000000 --- a/accounting/models.py +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright 2023 © AE UTBM -# ae@utbm.fr / ae.info@utbm.fr -# -# This file is part of the website of the UTBM Student Association (AE UTBM), -# https://ae.utbm.fr. -# -# You can find the source code of the website at https://github.com/ae-utbm/sith -# -# LICENSED UNDER THE GNU GENERAL PUBLIC LICENSE VERSION 3 (GPLv3) -# SEE : https://raw.githubusercontent.com/ae-utbm/sith/master/LICENSE -# OR WITHIN THE LOCAL FILE "LICENSE" -# -# diff --git a/core/management/commands/populate.py b/core/management/commands/populate.py index 6bcc0e78..96d322f2 100644 --- a/core/management/commands/populate.py +++ b/core/management/commands/populate.py @@ -839,8 +839,7 @@ Welcome to the wiki page! accounting_admin.permissions.add( *list( perms.filter( - Q(content_type__app_label="accounting") - | Q( + Q( codename__in=[ "view_customer", "view_product", diff --git a/core/static/core/style.scss b/core/static/core/style.scss index 37217080..58b188fc 100644 --- a/core/static/core/style.scss +++ b/core/static/core/style.scss @@ -526,33 +526,6 @@ body { } } -/*---------------------------ACCOUNTING----------------------------*/ -#accounting { - .journal-table { - tbody { - .neg-amount { - color: red; - - &:before { - font-family: FontAwesome; - font-size: 1em; - content: "\f063"; - } - } - - .pos-amount { - color: green; - - &:before { - font-family: FontAwesome; - font-size: 1em; - content: "\f062"; - } - } - } - } -} - /*-----------------------------GENERAL-----------------------------*/ h1, h2, diff --git a/counter/templates/counter/refound_account.jinja b/counter/templates/counter/refound_account.jinja index 9e726a24..2f43b0a9 100644 --- a/counter/templates/counter/refound_account.jinja +++ b/counter/templates/counter/refound_account.jinja @@ -5,12 +5,12 @@ {% endblock %} {% block content %} -
+

{% trans %}Refound account{% endtrans %}

{% csrf_token %} {{ form.as_p() }}

-
+ {% endblock %} \ No newline at end of file diff --git a/docs/tutorial/structure.md b/docs/tutorial/structure.md index 7c740bde..b687d25b 100644 --- a/docs/tutorial/structure.md +++ b/docs/tutorial/structure.md @@ -24,66 +24,64 @@ sith/ ├── .github/ │ ├── actions/ (1) │ └── workflows/ (2) -├── accounting/ (3) +├── club/ (3) │ └── ... -├── club/ (4) +├── com/ (4) │ └── ... -├── com/ (5) +├── core/ (5) │ └── ... -├── core/ (6) +├── counter/ (6) │ └── ... -├── counter/ (7) +├── docs/ (7) │ └── ... -├── docs/ (8) +├── eboutic/ (8) │ └── ... -├── eboutic/ (9) +├── election/ (9) │ └── ... -├── election/ (10) +├── forum/ (10) │ └── ... -├── forum/ (11) +├── galaxy/ (11) │ └── ... -├── galaxy/ (12) +├── launderette/ (12) │ └── ... -├── launderette/ (13) +├── locale/ (13) │ └── ... -├── locale/ (14) +├── matmat/ (14) │ └── ... -├── matmat/ (15) +├── pedagogy/ (15) │ └── ... -├── pedagogy/ (16) +├── rootplace/ (16) │ └── ... -├── rootplace/ (17) +├── sas/ (17) │ └── ... -├── sas/ (18) +├── sith/ (18) │ └── ... -├── sith/ (19) +├── subscription/ (19) │ └── ... -├── subscription/ (20) +├── trombi/ (20) │ └── ... -├── trombi/ (21) +├── antispam/ (21) │ └── ... -├── antispam/ (22) +├── staticfiles/ (22) │ └── ... -├── staticfiles/ (23) -│ └── ... -├── processes/ (24) +├── processes/ (23) │ └── ... │ -├── .coveragerc (25) -├── .envrc (26) +├── .coveragerc (24) +├── .envrc (25) ├── .gitattributes ├── .gitignore ├── .mailmap -├── .env (27) -├── .env.example (28) -├── manage.py (29) -├── mkdocs.yml (30) +├── .env (26) +├── .env.example (27) +├── manage.py (28) +├── mkdocs.yml (29) ├── uv.lock -├── pyproject.toml (31) -├── .venv/ (32) -├── .python-version (33) -├── Procfile.static (34) -├── Procfile.service (35) +├── pyproject.toml (30) +├── .venv/ (31) +├── .python-version (32) +├── Procfile.static (33) +├── Procfile.service (34) └── README.md ``` @@ -96,55 +94,54 @@ sith/ des workflows Github. Par exemple, le workflow `docs.yml` compile et publie la documentation à chaque push sur la branche `master`. -3. Application de gestion de la comptabilité. -4. Application de gestion des clubs et de leurs membres. -5. Application contenant les fonctionnalités +3. Application de gestion des clubs et de leurs membres. +4. Application contenant les fonctionnalités destinées aux responsables communication de l'AE. -6. Application contenant la modélisation centrale du site. +5. Application contenant la modélisation centrale du site. On en reparle plus loin sur cette page. -7. Application de gestion des comptoirs, des permanences +6. Application de gestion des comptoirs, des permanences sur ces comptoirs et des transactions qui y sont effectuées. -8. Dossier contenant la documentation. -9. Application de gestion de la boutique en ligne. -10. Application de gestion des élections. -11. Application de gestion du forum -12. Application de gestion de la galaxie ; la galaxie +7. Dossier contenant la documentation. +8. Application de gestion de la boutique en ligne. +9. Application de gestion des élections. +10. Application de gestion du forum +11. Application de gestion de la galaxie ; la galaxie est un graphe des niveaux de proximité entre les différents étudiants. -13. Gestion des machines à laver de l'AE -14. Dossier contenant les fichiers de traduction. -15. Fonctionnalités de recherche d'utilisateurs. -16. Le guide des UEs du site, sur lequel les utilisateurs +12. Gestion des machines à laver de l'AE +13. Dossier contenant les fichiers de traduction. +14. Fonctionnalités de recherche d'utilisateurs. +15. Le guide des UEs du site, sur lequel les utilisateurs peuvent également laisser leurs avis. -17. Fonctionnalités utiles aux utilisateurs root. -18. Le SAS, où l'on trouve toutes les photos de l'AE. -19. Application principale du projet, contenant sa configuration. -20. Gestion des cotisations des utilisateurs du site. -21. Outil pour faciliter la fabrication des trombinoscopes de promo. -22. Fonctionnalités pour gérer le spam. -23. Gestion des statics du site. Override le système de statics de Django. +16. Fonctionnalités utiles aux utilisateurs root. +17. Le SAS, où l'on trouve toutes les photos de l'AE. +18. Application principale du projet, contenant sa configuration. +19. Gestion des cotisations des utilisateurs du site. +20. Outil pour faciliter la fabrication des trombinoscopes de promo. +21. Fonctionnalités pour gérer le spam. +22. Gestion des statics du site. Override le système de statics de Django. Ajoute l'intégration du scss et du bundler js de manière transparente pour l'utilisateur. -24. Module de gestion des services externes. +23. Module de gestion des services externes. Offre une API simple pour utiliser les fichiers `Procfile.*`. -25. Fichier de configuration de coverage. -26. Fichier de configuration de direnv. -27. Contient les variables d'environnement, qui sont susceptibles +24. Fichier de configuration de coverage. +25. Fichier de configuration de direnv. +26. Contient les variables d'environnement, qui sont susceptibles de varier d'une machine à l'autre. -28. Contient des valeurs par défaut pour le `.env` +27. Contient des valeurs par défaut pour le `.env` pouvant convenir à un environnment de développement local -29. Fichier généré automatiquement par Django. C'est lui +28. Fichier généré automatiquement par Django. C'est lui qui permet d'appeler des commandes de gestion du projet avec la syntaxe `python ./manage.py ` -30. Le fichier de configuration de la documentation, +29. Le fichier de configuration de la documentation, avec ses plugins et sa table des matières. -31. Le fichier où sont déclarés les dépendances et la configuration +30. Le fichier où sont déclarés les dépendances et la configuration de certaines d'entre elles. -32. Dossier d'environnement virtuel généré par uv -33. Fichier qui contrôle quelle version de python utiliser pour le projet -34. Fichier qui contrôle les commandes à lancer pour gérer la compilation +31. Dossier d'environnement virtuel généré par uv +32. Fichier qui contrôle quelle version de python utiliser pour le projet +33. Fichier qui contrôle les commandes à lancer pour gérer la compilation automatique des static et autres services nécessaires à la command runserver. -35. Fichier qui contrôle les services tiers nécessaires au fonctionnement +34. Fichier qui contrôle les services tiers nécessaires au fonctionnement du Sith tel que redis. ## L'application principale diff --git a/sith/settings.py b/sith/settings.py index 7e3ef14f..5ccbd136 100644 --- a/sith/settings.py +++ b/sith/settings.py @@ -110,7 +110,6 @@ INSTALLED_APPS = ( "core", "club", "subscription", - "accounting", "counter", "eboutic", "launderette",