It seems possible that a recall can be issued that actually extends
the loan period for an item with semester or other generous loan
periods. This adds a check for the current loan period and uses it
if the calculated threshold date is later.
Signed-off-by: Art Rhyno <art632000@yahoo.ca>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
$return_date = $threshold_date;
}
+ # Ensure that new loan period is not longer than original due date, if it is, stick with original date
+ if (DateTime->compare(DateTime::Format::ISO8601->parse_datetime($circ->due_date),DateTime::Format::ISO8601->parse_datetime($return_date)) == -1) {
+ $return_date = $circ->due_date;
+ };
+
my $update_fields = {
due_date => $return_date,
renewal_remaining => 0,