From 940ca2abfe29f0203dd226d4ce00e8dc5e1aa421 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 21 Nov 2016 18:54:40 +0000 Subject: [PATCH] Bug 17665 - SIP2 Item Information Response returns incorrect circulation status of '08' ( waiting on hold shelf ) if record has any holds 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' --- C4/SIP/ILS/Item.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 578f382..ad5a964 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -244,13 +244,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 { -- 2.1.4