From 986ef9ac2295f9c280ddbc35919ac2bb7b1c0cc6 Mon Sep 17 00:00:00 2001 From: Laura Escamilla Date: Tue, 19 Dec 2023 18:31:54 +0000 Subject: [PATCH] Bug 34950: Add availability statuses for in transit and on hold items. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test: 1. Enable the ILS-DI system preference. 2. Place a hold for a patron and put it in transit. Place another hold for a patron that is available for pickup at the local branch. And then select an item that is available for checkout but don’t change the status for it. 3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using the item ids of the three items you worked with in step 2. (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item) 4. Notice that the availability status for all three items is showing as available. The item in transit and the item with a local hold should have a status of not available and a message of why they are not available. 5. Apply the patch 6. Use restart_all. 7. Refresh the page and notice that the statuses are now correct. The item in transit has a status of not available and an availability message of “In transit”. The item with the local hold has an availability status of not available with an availability message of “On hold”. Finally the available item is correctly showing up as available. 8. Sign off and have a wonderful day. :) Signed-off-by: Brendan Lawlor Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Katrin Fischer (cherry picked from commit 122f29cd8f4d1067e8ccaf64ecb0f13cc7b85d9a) Signed-off-by: Fridolin Somers --- C4/ILSDI/Services.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index f01dd34770..aa21a4e714 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -980,6 +980,10 @@ sub _availability { return ( $biblionumber, __('not available'), __('Item withdrawn'), $location, $itemcallnumber ); } elsif ( $item->damaged ) { return ( $biblionumber, __('not available'), __('Item damaged'), $location, $itemcallnumber ); + } elsif ( $item->get_transfer ) { + return ( $biblionumber, __('not available'), __('In transit'), $location, $itemcallnumber ); + } elsif ( $item->current_holds->next ) { + return ( $biblionumber, __('not available'), __('On hold'), $location, $itemcallnumber ); } else { return ( $biblionumber, __('available'), undef, $location, $itemcallnumber ); } -- 2.39.5