@@ -, +, @@ DataTime::subtract wrong --- misc/cronjobs/holds/holds_reminder.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/misc/cronjobs/holds/holds_reminder.pl +++ a/misc/cronjobs/holds/holds_reminder.pl @@ -223,6 +223,8 @@ else { $date_to_run = dt_from_string(); } +my $waiting_date_static = $date_to_run->clone->subtract( days => $days ); + # Loop through each branch foreach my $branchcode (@branchcodes) { #BEGIN BRANCH LOOP # Check that this branch has the letter code specified or skip this branch @@ -248,7 +250,7 @@ foreach my $branchcode (@branchcodes) { #BEGIN BRANCH LOOP my $duration = DateTime::Duration->new( days => -$days ); $waiting_date = $calendar->addDays($date_to_run,$duration); #Add negative of days } else { - $waiting_date = $date_to_run->subtract( days => $days ); + $waiting_date = $waiting_date_static; } # Find all the holds waiting since this date for the current branch --