mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 16:03:21 +00:00
chore: commit qui sert à rien
This commit is contained in:
@ -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
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user