From 367c4d18cd9efdd578e3e59c82e888d3701d1b41 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 14 Aug 2023 00:45:00 +0000 Subject: [PATCH] Bug 30913: Show notforloan from itemtype for ILS-DI GetRecords This patch sets notforloan for an item if its itemtype is set to notforloan, when creating the ILS-DI GetRecords response. To test: 0. Apply the patch 1. koha-plack --restart kohadev 2. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI 3. Enable the ILS-DI API 4. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29 5. Note the "notforloan" is 0 6. Go to http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK 7. Checkbox the "Not for loan" and save 8. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29 9. Note the "notforloan" is 1 --- C4/ILSDI/Services.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 77243a882a..a995ee1385 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -267,6 +267,12 @@ sub GetRecords { } } + if ( $item->itemtype && $item->itemtype->notforloan ){ + if ( ! $item->notforloan ){ + $item{notforloan} = 1; + } + } + my $transfer = $item->get_transfer; if ($transfer) { $item{transfer} = { -- 2.30.2