From: Kyle M Hall Date: Tue, 8 Jan 2019 15:40:21 +0000 (-0500) Subject: Bug 19619: Add support for SIP2 field CM ( Hold Pickup Date ) to Koha X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=f88923c05a303fc0d458055b1d27a17a775f07d1 Bug 19619: Add support for SIP2 field CM ( Hold Pickup Date ) to Koha The CM field was all set up for implementation, but never completed. We should fully implement the CM ( Hold Pickup Date ), which according to the SIP2 protocol specification is "The date that the hold expires". Test Plan: 1) Set up a waiting hold for an item 2) Using the sip cli emulator, send an item information request for that item 3) Note the CM field does not show up 4) Apply this patch 5) Restart all the things! 6) Repeat the item information request 7) Note the CM field is now transmitted! Signed-off-by: Liz Rea Signed-off-by: Chris Cormack Signed-off-by: Nick Clemens --- diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 7e246bc..7a88570 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -28,6 +28,7 @@ use Koha::Checkouts; use Koha::DateUtils; use Koha::Patrons; use Koha::Items; +use Koha::Holds; =encoding UTF-8 @@ -325,7 +326,13 @@ sub recall_date { } sub hold_pickup_date { my $self = shift; - return $self->{hold_pickup_date} || 0; + + my $hold = Koha::Holds->find({ itemnumber => $self->{itemnumber}, found => 'W' }); + if ( $hold ) { + return $hold->expirationdate || 0; + } + + return 0; } # This is a partial check of "availability". It is not supposed to check everything here.