Fix a bug in rec. trx. handling of HWT NW and occurrence at sunday

This commit is contained in:
2019-09-15 20:01:08 +02:00
parent aa60d580e2
commit f6cdec638e
2 changed files with 43 additions and 1 deletions

View File

@@ -265,6 +265,18 @@ public class RecurringTransactionService {
return false; // early return
}
// If today is a weekend day or holiday the recurring transaction cannot be due today, because the
// holiday weekend type says PREVIOUS_WORKDAY.
if (this.ruleService.isHoliday(now) || this.ruleService.isWeekend(now)) {
LOGGER.debug(String.format("Recurring transaction %s has HWT %s and today is either a holiday or weekend," +
" thus it cannot be due in the future",
ReflectionToStringBuilder.toString(recurringTransaction),
recurringTransaction.getHolidayWeekendType()));
return false; // early return
}
boolean weekend;
boolean holiday;
LocalDate tomorrow = now;