Bug 17665 - SIP2 Item Information Response returns incorrect circulation status of...
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 21 Nov 2016 18:54:40 +0000 (18:54 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 19 May 2017 14:30:45 +0000 (10:30 -0400)
If a record has any holds on it, the SIP2 item information response will
return a value of 08 "waiting on hold shelf" even if the item is not
actually a waiting hold. This is clearly a bug.

Test Plan:
1) Find an item that is not a waiting hold, but whose record has one or
   more holds.
2) Issue a SIP2 item information request
3) Note in the response, the circulation status field is '08'
4) Apply this patch
5) Repeat the item informationr request
6) Note the code is now '03' ( available )
7) Check the item in to fill the hold
8) Repeat the item information request
9) Verify the circulation status is now '08'

Followed test plan, works as expected
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/SIP/ILS/Item.pm

index 3329497..0649799 100644 (file)
@@ -240,13 +240,15 @@ sub title_id {
 
 sub sip_circulation_status {
     my $self = shift;
-    if ($self->{patron}) {
-               return '04';    # charged
-    } elsif (scalar @{$self->{hold_queue}}) {
-               return '08';    # waiting on hold shelf
-    } else {
-               return '03';    # available
-    }                   # FIXME: 01-13 enumerated in spec.
+    if ( $self->{patron} ) {
+        return '04';    # charged
+    }
+    elsif ( grep { $_->{itemnumber} == $self->{itemnumber}  } @{ $self->{hold_shelf} } ) {
+        return '08';    # waiting on hold shelf
+    }
+    else {
+        return '03';    # available
+    }    # FIXME: 01-13 enumerated in spec.
 }
 
 sub sip_security_marker {