|
|
@ -151,17 +151,23 @@ class CooperativeStatus(models.Model): |
|
|
|
rec.irregular_start_date, date |
|
|
|
) |
|
|
|
# Check holidays |
|
|
|
if (rec.holiday_start_time and rec.holiday_end_time |
|
|
|
if ( |
|
|
|
rec.holiday_start_time and rec.holiday_end_time |
|
|
|
and date >= rec.holiday_start_time |
|
|
|
and date <= rec.holiday_end_time): |
|
|
|
and date <= rec.holiday_end_time |
|
|
|
): |
|
|
|
date = add_days_delta(date, 1) |
|
|
|
continue |
|
|
|
# Check temporary exemption |
|
|
|
elif (rec.temporary_exempt_start_date |
|
|
|
if ( |
|
|
|
rec.temporary_exempt_start_date |
|
|
|
and rec.temporary_exempt_end_date |
|
|
|
and date >= rec.temporary_exempt_start_date |
|
|
|
and date <= rec.temporary_exempt_end_date): |
|
|
|
and date <= rec.temporary_exempt_end_date |
|
|
|
): |
|
|
|
date = add_days_delta(date, 1) |
|
|
|
continue |
|
|
|
else: |
|
|
|
# Otherwise |
|
|
|
counter -= 1 |
|
|
|
date = add_days_delta(date, 1) |
|
|
|
rec.future_alert_date = self._next_countdown_date( |
|
|
@ -195,19 +201,23 @@ class CooperativeStatus(models.Model): |
|
|
|
while not next_countdown_date: |
|
|
|
date = self._next_countdown_date(rec.irregular_start_date, date) |
|
|
|
# Check holidays |
|
|
|
if (rec.holiday_start_time and rec.holiday_end_time |
|
|
|
if ( |
|
|
|
rec.holiday_start_time and rec.holiday_end_time |
|
|
|
and date >= rec.holiday_start_time |
|
|
|
and date <= rec.holiday_end_time): |
|
|
|
and date <= rec.holiday_end_time |
|
|
|
): |
|
|
|
date = add_days_delta(date, 1) |
|
|
|
continue |
|
|
|
# Check temporary exemption |
|
|
|
elif (rec.temporary_exempt_start_date |
|
|
|
if ( |
|
|
|
rec.temporary_exempt_start_date |
|
|
|
and rec.temporary_exempt_end_date |
|
|
|
and date >= rec.temporary_exempt_start_date |
|
|
|
and date <= rec.temporary_exempt_end_date): |
|
|
|
and date <= rec.temporary_exempt_end_date |
|
|
|
): |
|
|
|
date = add_days_delta(date, 1) |
|
|
|
continue |
|
|
|
else: |
|
|
|
# Otherwise |
|
|
|
next_countdown_date = date |
|
|
|
rec.next_countdown_date = next_countdown_date |
|
|
|
|
|
|
|