From f88923c05a303fc0d458055b1d27a17a775f07d1 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! Signed-off-by: Liz Rea Signed-off-by: Chris Cormack Signed-off-by: Nick Clemens --- 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 7e246bc59b..7a88570823 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.39.5