From c9e37ef020da5098d1702d007e6185ce8959ed69 Mon Sep 17 00:00:00 2001 From: Art Rhyno Date: Sat, 22 Sep 2012 00:46:20 -0400 Subject: [PATCH] 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 --- .../src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm | 5 +++++ 1 file changed, 5 insertions(+) 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 4101309eae..64fc01ba3b 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 @@ -1626,6 +1626,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, -- 2.11.0