From: Bill Erickson Date: Tue, 27 Dec 2011 21:34:46 +0000 (-0500) Subject: Use hold current shelf lib to determine availability : A/T validator X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bcef00bd27782fa730bf3b82c263c1e8c421245f;p=evergreen%2Fmasslnc.git Use hold current shelf lib to determine availability : A/T validator The availability of a hold can now be determined by hold.current_shelf_lib == hold.pickup_lib. This change updates the HoldIsAvailable action/trigger validator to use the new test. I've left the original belt-and-suspenders checks in place and marked them as redundant within the code for reference. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Validator.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Validator.pm index 54847b3c46..57563e02f5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Validator.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Validator.pm @@ -75,11 +75,13 @@ sub HoldIsAvailable { return 1 if !$hold->cancel_time and - $hold->capture_time and - $hold->current_copy and - $hold->shelf_time and !$hold->fulfillment_time and - $hold->current_copy->status == OILS_COPY_STATUS_ON_HOLDS_SHELF; + $hold->current_shelf_lib and + $hold->current_shelf_lib eq $hold->pickup_lib and + $hold->capture_time and # redundant + $hold->current_copy and # redundant + $hold->shelf_time and # redundant + $hold->current_copy->status == OILS_COPY_STATUS_ON_HOLDS_SHELF; # redundant return 0; }