3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-22 03:13:12 +00:00

Merge pull request #3 from nanoy42/fix-3.6.1

Fix 3.6.1
This commit is contained in:
nanoy42 2019-06-27 23:05:11 +02:00 committed by GitHub
commit 94b3c47326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 63 additions and 7 deletions

View file

@ -1,3 +1,5 @@
## v3.6.1
* Valeur par défaut des répartitions et calcul des répartitions
## v3.6.0 ## v3.6.0
* AJout d'un débit direct comme champ du profil * AJout d'un débit direct comme champ du profil
* Suppression des codes bare * Suppression des codes bare

View file

@ -994,14 +994,14 @@ def divide(request):
cotisation_history.save() cotisation_history.save()
divide_history = DivideHistory( divide_history = DivideHistory(
total_cotisations = non_divided_cotisations.count(), total_cotisations = non_divided_cotisations.count(),
total_cotisations_amount = sum([x.amount for x in non_divided_cotisations]), total_cotisations_amount = sum([x.amount or 0 for x in non_divided_cotisations]),
total_ptm_amount = sum([x.amount_ptm for x in non_divided_cotisations]), total_ptm_amount = sum([x.amount_ptm or 0 for x in non_divided_cotisations]),
coopeman = request.user coopeman = request.user
) )
divide_history.save() divide_history.save()
non_divided_cotisations = CotisationHistory.objects.filter(divided=False) non_divided_cotisations = CotisationHistory.objects.filter(divided=False)
total_amount = sum([x.amount for x in non_divided_cotisations]) total_amount = sum([x.amount or 0 for x in non_divided_cotisations])
total_amount_ptm = sum([x.amount_ptm for x in non_divided_cotisations]) total_amount_ptm = sum([x.amount_ptm or 0 for x in non_divided_cotisations])
divide_histories = DivideHistory.objects.all().order_by('-date') divide_histories = DivideHistory.objects.all().order_by('-date')
return render( return render(
request, request,

View file

@ -0,0 +1,27 @@
# Generated by Django 2.1 on 2019-06-27 21:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('preferences', '0017_auto_20190623_1453'),
]
operations = [
migrations.AlterModelOptions(
name='priceprofile',
options={'verbose_name': 'Profil de prix', 'verbose_name_plural': 'Profils de prix'},
),
migrations.AlterField(
model_name='cotisation',
name='amount_ptm',
field=models.DecimalField(decimal_places=2, default=0, max_digits=5, null=True, verbose_name='Montant pour le club Phœnix Technopôle Metz'),
),
migrations.AlterField(
model_name='historicalcotisation',
name='amount_ptm',
field=models.DecimalField(decimal_places=2, default=0, max_digits=5, null=True, verbose_name='Montant pour le club Phœnix Technopôle Metz'),
),
]

View file

@ -129,7 +129,7 @@ class Cotisation(models.Model):
""" """
Duration (in days) of the cotisation Duration (in days) of the cotisation
""" """
amount_ptm = models.DecimalField(max_digits=5, decimal_places=2, null=True, verbose_name="Montant pour le club Phœnix Technopôle Metz") amount_ptm = models.DecimalField(max_digits=5, decimal_places=2, null=True, verbose_name="Montant pour le club Phœnix Technopôle Metz", default=0)
""" """
Amount of money given to the PTM club Amount of money given to the PTM club
""" """
@ -178,6 +178,10 @@ class PriceProfile(models.Model):
""" """
Stores parameters to compute price Stores parameters to compute price
""" """
class Meta:
verbose_name = "Profil de prix"
verbose_name_plural = "Profils de prix"
name = models.CharField(max_length=255, verbose_name="Nom") name = models.CharField(max_length=255, verbose_name="Nom")
a = models.DecimalField(verbose_name="Marge constante", max_digits=3, decimal_places=2) a = models.DecimalField(verbose_name="Marge constante", max_digits=3, decimal_places=2)
b = models.DecimalField(verbose_name="Marge variable", max_digits=3, decimal_places=2) b = models.DecimalField(verbose_name="Marge variable", max_digits=3, decimal_places=2)

View file

@ -42,6 +42,6 @@
<li><a href="https://www.facebook.com/coopesmetz/" class="icon fa-facebook alt"><span class="label">Facebook</span></a></li> <li><a href="https://www.facebook.com/coopesmetz/" class="icon fa-facebook alt"><span class="label">Facebook</span></a></li>
</ul> </ul>
</section> </section>
<p class="copyright">coope.rez v3.6.0 (release stable) &copy; 2018-2019 Yoann Pietri.</p> <p class="copyright">coope.rez v3.6.1 (release stable) &copy; 2018-2019 Yoann Pietri.</p>

View file

@ -0,0 +1,23 @@
# Generated by Django 2.1 on 2019-06-27 21:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0010_auto_20190623_1656'),
]
operations = [
migrations.AlterField(
model_name='cotisationhistory',
name='amount_ptm',
field=models.DecimalField(decimal_places=2, default=0, max_digits=5, null=True, verbose_name='Montant pour le club Phœnix Technopôle Metz'),
),
migrations.AlterField(
model_name='historicalcotisationhistory',
name='amount_ptm',
field=models.DecimalField(decimal_places=2, default=0, max_digits=5, null=True, verbose_name='Montant pour le club Phœnix Technopôle Metz'),
),
]

View file

@ -65,7 +65,7 @@ class CotisationHistory(models.Model):
""" """
True if money of cotisation have been divided between CTM and PTM True if money of cotisation have been divided between CTM and PTM
""" """
amount_ptm = models.DecimalField(max_digits=5, decimal_places=2, null=True, verbose_name="Montant pour le club Phœnix Technopôle Metz") amount_ptm = models.DecimalField(max_digits=5, decimal_places=2, null=True, verbose_name="Montant pour le club Phœnix Technopôle Metz", default=0)
""" """
Amount of money given to the PTM club Amount of money given to the PTM club
""" """