From: senator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Thu, 17 Feb 2011 20:53:36 +0000 (+0000)
Subject: Booking: fix the targeter in the I'm-reserving-this-exact-resource-with-this-
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=871b8e0c83e5ddb7c6dc4b6444c5d50956c93b09;p=evergreen%2Fmasslnc.git

Booking: fix the targeter in the I'm-reserving-this-exact-resource-with-this-
exact-barcode case.

It should have always worked like this. This should better mirror the behavior
in the holds targeter when placing a copy-level hold.  Basically don't fail
to target a resource for a reservation later just because it's not in an
available status right at this moment.


git-svn-id: svn://svn.open-ils.org/ILS/trunk@19470 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

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 6b96ffabca..6295a62782 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
@@ -1689,6 +1689,14 @@ sub reservation_targeter {
                     next;
                 }
 
+                # At this point, if we're just targeting one specific
+                # resource, just succeed. We don't care about its present
+                # copy status.
+                if ($bresv->target_resource) {
+                    push @good_resources, $res;
+                    next;
+                }
+
                 if ($copy->status->id == 0 || $copy->status->id == 7) {
                     push @good_resources, $res;
                     next;