mirror of https://github.com/nanoy42/coope
14 changed files with 297 additions and 6 deletions
@ -0,0 +1,77 @@ |
|||
{% extends 'base.html' %} |
|||
{% block entete %}Répartition des cotisations{% endblock %} |
|||
{% block navbar %} |
|||
<ul> |
|||
<li><a href="#first">Répartition des cotisations</a></li> |
|||
<li><a href="#second">Historique des répartitions</a></li> |
|||
</ul> |
|||
{% endblock %} |
|||
{% block content %} |
|||
<section id="first" class="main"> |
|||
<header class="major"> |
|||
<h2>Répartition des cotisations</h2> |
|||
</header> |
|||
<section> |
|||
<div class="table-wrapper"> |
|||
<table> |
|||
<thead> |
|||
<tr> |
|||
<th>Champ</th> |
|||
<th>Valeur</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<td>Nombre de cotisations non réparties</td> |
|||
<td>{{total_cotisations}}</td> |
|||
</tr> |
|||
<tr> |
|||
<td>Valeur totale des cotisations non réparties</td> |
|||
<td>{{total_amount}} €</td> |
|||
</tr> |
|||
<tr> |
|||
<td>Valeur à donner au Club Phœnix Technopôle Metz</td> |
|||
<td>{{total_amount_ptm}} €</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<form action="" method="post"> |
|||
{% csrf_token %} |
|||
<button type="submit"><i class="fa fa-hand-holding-usd"></i> Répartir</button> |
|||
</form> |
|||
<p>Attention, cliquer sur ce bouton marquera toutes les cotisations actuellement non réparties comme réparties. L'historique de cette action n'est pas simple à obtenir et l'action peut être considérée comme irreversible.</p> |
|||
</section> |
|||
</section> |
|||
<section id="second" class="main"> |
|||
<header class="major"> |
|||
<h2>Historique des répartitions</h2> |
|||
</header> |
|||
<section> |
|||
<div class="table-wrapper"> |
|||
<table> |
|||
<thead> |
|||
<tr> |
|||
<th>Date</th> |
|||
<th>Nombre de cotisations</th> |
|||
<th>Montant des cotisations</th> |
|||
<th>Montant des cotisations pourle Phœnix</th> |
|||
<th>Coopeman</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{% for divide_history in divide_histories %} |
|||
<tr> |
|||
<td>{{ divide_history.date }}</td> |
|||
<td>{{ divide_history.total_cotisations }}</td> |
|||
<td>{{ divide_history.total_cotisations_amount }} €</td> |
|||
<td>{{ divide_history.total_ptm_amount }} €</td> |
|||
<td>{{ divide_history.coopeman }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</section> |
|||
</section> |
|||
{% endblock %} |
|||
@ -0,0 +1,23 @@ |
|||
# Generated by Django 2.1 on 2019-06-22 21:34 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('preferences', '0012_auto_20190428_1327'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='cotisation', |
|||
name='amount_ptm', |
|||
field=models.DecimalField(decimal_places=2, max_digits=5, null=True, verbose_name='Montant pour le club Phœnix Technopôle Metz'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='historicalcotisation', |
|||
name='amount_ptm', |
|||
field=models.DecimalField(decimal_places=2, max_digits=5, null=True, verbose_name='Montant pour le club Phœnix Technopôle Metz'), |
|||
), |
|||
] |
|||
@ -0,0 +1,17 @@ |
|||
# Generated by Django 2.1 on 2019-06-23 07:57 |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('preferences', '0013_auto_20190622_2334'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='cotisation', |
|||
options={'permissions': (('can_divide', 'Can divide money for cotisation'),)}, |
|||
), |
|||
] |
|||
@ -0,0 +1,30 @@ |
|||
# Generated by Django 2.1 on 2019-06-23 08:49 |
|||
|
|||
from django.conf import settings |
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
|||
('preferences', '0014_auto_20190623_0957'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='DivideHistory', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('date', models.DateTimeField(auto_now_add=True)), |
|||
('total_cotisations', models.IntegerField(verbose_name='Nombre de cotisations')), |
|||
('total_cotisations_amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Montant total des cotisations')), |
|||
('total_ptm_amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Montant donné au Phœnix Technopôle Metz')), |
|||
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='divide_realized', to=settings.AUTH_USER_MODEL)), |
|||
], |
|||
options={ |
|||
'verbose_name': 'Historique répartition', |
|||
}, |
|||
), |
|||
] |
|||
@ -0,0 +1,42 @@ |
|||
# Generated by Django 2.1 on 2019-06-23 07:57 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
def update(apps, schema_editor): |
|||
CotisationHistory = apps.get_model('users', 'CotisationHistory') |
|||
for cotisation_history in CotisationHistory.objects.all(): |
|||
cotisation_history.amount_ptm = cotisation_history.cotisation.amount_ptm |
|||
cotisation_history.save() |
|||
|
|||
def reverse_update(apps, schema_editor): |
|||
pass |
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('users', '0006_auto_20190611_0105'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='cotisationhistory', |
|||
name='amount_ptm', |
|||
field=models.DecimalField(decimal_places=2, max_digits=5, null=True, verbose_name='Montant pour le club Phœnix Technopôle Metz'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='cotisationhistory', |
|||
name='divided', |
|||
field=models.BooleanField(default=False, verbose_name='Répartition'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='historicalcotisationhistory', |
|||
name='amount_ptm', |
|||
field=models.DecimalField(decimal_places=2, max_digits=5, null=True, verbose_name='Montant pour le club Phœnix Technopôle Metz'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='historicalcotisationhistory', |
|||
name='divided', |
|||
field=models.BooleanField(default=False, verbose_name='Répartition'), |
|||
), |
|||
migrations.RunPython(update, reverse_update) |
|||
] |
|||
Loading…
Reference in new issue