From f70ab5bbf30d6fd5166b90e8bb357f18e4c6b32b Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 17 Dec 2018 14:41:48 -0500 Subject: [PATCH] Bug 22016: Always send CT field for SIP checkin, even if empty Some SIP devices ( in this particular case, bin sorting machines from RFID Library Solutions ) require a CT field to be sent, even if that field is empty. Koha should be able to support this behavior. Test Plan: 1) Apply this patch 2) Enable the new option ct_always_send for a SIP2 account 3) Restart SIP 4) Check in an item successfully via SIP, which will not be transferred 5) Note the response contains a CT field with no value Sponsored-by: Pueblo City-County Library District Signed-off-by: Kyle M Hall Signed-off-by: Jill Kleven --- C4/SIP/Sip/MsgType.pm | 2 +- etc/SIPconfig.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm index 9971a69a95..55f53e80d6 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -673,7 +673,7 @@ sub handle_checkin { $resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties ); $resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code ); $resp .= maybe_add( FID_CALL_NUMBER, $item->call_number ); - $resp .= maybe_add( FID_DESTINATION_LOCATION, $item->destination_loc ); + $resp .= add_field( FID_DESTINATION_LOCATION, $item->destination_loc ) if ( $item->destination_loc || $server->{account}->{ct_always_send} ); $resp .= maybe_add( FID_HOLD_PATRON_ID, $item->hold_patron_bcode ); $resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name( $server->{account}->{da_field_template} ) ); if ( $status->hold and $status->hold->{branchcode} ne $item->destination_loc ) { diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml index 49ff852698..7a2fd65cc3 100644 --- a/etc/SIPconfig.xml +++ b/etc/SIPconfig.xml @@ -52,6 +52,7 @@ delimiter="|" error-detect="enabled" institution="LPL" send_patron_home_library_in_af="1" cv_send_00_on_success="1" + ct_always_send="1" ae_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]" da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]" av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" > -- 2.17.2 (Apple Git-113)