From afd95ce7154a73d5821ec61e776f624a9c928ee9 Mon Sep 17 00:00:00 2001 From: Gael Le Mignot Date: Mon, 6 Sep 2021 16:07:32 +0200 Subject: [PATCH] Minor bug fix in generating payments --- teleforma/models/crfpa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teleforma/models/crfpa.py b/teleforma/models/crfpa.py index 8fbe6a53..4f406d43 100755 --- a/teleforma/models/crfpa.py +++ b/teleforma/models/crfpa.py @@ -317,7 +317,7 @@ class Student(models.Model): if month > 12: year += 1 month -= 12 - return datetime.date(year, month + 1, 1) - oneday + return datetime.date(year, month, 1) - oneday oral_date = None payments = None @@ -352,7 +352,7 @@ class Student(models.Model): # look at 01/m+1 and then remove one day date = endofmonth(tomorrow.year, tomorrow.month + 1 + i) payments += ((part, date),) - oral_date = endofmonth(tomorrow.year, 8) + oral_date = endofmonth(tomorrow.year, max(tomorrow.month, 8)) else: # Normal registration, so end of june and end of # july -- 2.39.5