From: Gael Le Mignot Date: Mon, 6 Sep 2021 14:07:32 +0000 (+0200) Subject: Minor bug fix in generating payments X-Git-Tag: 2.5.0~66 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=afd95ce7154a73d5821ec61e776f624a9c928ee9;p=teleforma.git Minor bug fix in generating payments --- 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