From: Art Rhyno Date: Sat, 22 Sep 2012 04:46:20 +0000 (-0400) Subject: Check to see if existing loan date is less than recall date X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f1141e96f1ba9136659e5cabcb605c1c82c16f74;p=contrib%2FConifer.git Check to see if existing loan date is less than recall date 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 Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index ed5c4adb37..20ed65fba5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -1862,6 +1862,11 @@ sub process_recall { $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,