chore: commit qui sert à rien

This commit is contained in:
N3WT DE COMPET
2025-02-13 17:13:31 +01:00
parent 9bf9c5f62d
commit cce78355a3
17 changed files with 210 additions and 143 deletions

View File

@ -1,7 +1,7 @@
from django.core.management.base import BaseCommand
from django.utils import timezone
from dateutil.relativedelta import relativedelta
from School.models import PaymentPlan, PaymentPlanType, FeeType
from School.models import PaymentPlan, PaymentPlanType, FeeType, Establishment
class Command(BaseCommand):
help = 'Initialize or update Payment Plans'
@ -11,6 +11,7 @@ class Command(BaseCommand):
def create_or_update_payment_plans(self):
current_date = timezone.now().date()
establishment = Establishment.objects.get(name="N3WT")
for fee_type in FeeType.choices:
fee_type_value = fee_type[0]
@ -21,7 +22,8 @@ class Command(BaseCommand):
type=fee_type_value,
defaults={
'due_dates': [current_date + relativedelta(months=1)],
'is_active': True
'is_active': True,
'establishment': establishment
}
)
@ -31,7 +33,8 @@ class Command(BaseCommand):
type=fee_type_value,
defaults={
'due_dates': [current_date + relativedelta(months=1+4*i) for i in range(3)],
'is_active': False
'is_active': False,
'establishment': establishment
}
)
@ -41,7 +44,8 @@ class Command(BaseCommand):
type=fee_type_value,
defaults={
'due_dates': [current_date + relativedelta(months=1+i) for i in range(10)],
'is_active': False
'is_active': False,
'establishment': establishment
}
)
@ -51,7 +55,8 @@ class Command(BaseCommand):
type=fee_type_value,
defaults={
'due_dates': [current_date + relativedelta(months=1+i) for i in range(12)],
'is_active': False
'is_active': False,
'establishment': establishment
}
)