From f4e982e6dbaa30d17e8c62ca7ebc9b2b39276b84 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 8 Jan 2019 10:40:21 -0500 Subject: [PATCH] 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! --- C4/SIP/ILS/Item.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 240e1990a0..a974188dd9 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. -- 2.17.2 (Apple Git-113)