fix: Calcul du montant total des tarif par RF + affichage des tarifs

actifs lors de la création d'un RF [#26]
This commit is contained in:
N3WT DE COMPET
2025-02-07 20:36:02 +01:00
parent f2628bb45a
commit c269b89d3d
12 changed files with 192 additions and 70 deletions

View File

@ -8,27 +8,6 @@ from School.models import SchoolClass, Fee, Discount
from datetime import datetime
class RegistrationFee(models.Model):
"""
Représente un tarif ou frais dinscription avec différentes options de paiement.
"""
class PaymentOptions(models.IntegerChoices):
SINGLE_PAYMENT = 0, _('Paiement en une seule fois')
MONTHLY_PAYMENT = 1, _('Paiement mensuel')
QUARTERLY_PAYMENT = 2, _('Paiement trimestriel')
name = models.CharField(max_length=255, unique=True)
description = models.TextField(blank=True)
base_amount = models.DecimalField(max_digits=10, decimal_places=2)
discounts = models.JSONField(blank=True, null=True)
supplements = models.JSONField(blank=True, null=True)
validity_start_date = models.DateField()
validity_end_date = models.DateField()
payment_option = models.IntegerField(choices=PaymentOptions, default=PaymentOptions.SINGLE_PAYMENT)
def __str__(self):
return self.name
class Language(models.Model):
"""
Représente une langue parlée par lélève.