From d7a0145f61dd675604925118eafffe35af03c5e5 Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@gmail.com>
Date: Mon, 5 Aug 2013 15:23:44 -0300
Subject: [PATCH] But 10663 - Revert and use CheckReserves for
 CanBookBeRenewed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It makes renewal lock by holds work again.
Unit tests as follow up

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
---
 C4/Circulation.pm |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index ca66931..aee1dbd 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -2484,8 +2484,9 @@ sub CanBookBeRenewed {
         $error = "too_many";
     }
 
-    my $resstatus = C4::Reserves::GetReserveStatus($itemnumber);
-    if ( $resstatus eq "Waiting" or $resstatus eq "Reserved" ) {
+    my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves( $itemnumber );
+
+    if ( defined $resfound ) {
         $renewokay = 0;
         $error = "on_reserve";
     }
-- 
1.7.9.5