Bug 22016: Always send CT field for SIP checkin, even if empty
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 17 Dec 2018 19:41:48 +0000 (14:41 -0500)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 27 Feb 2019 14:14:21 +0000 (09:14 -0500)
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 <kyle@bywatersolutions.com>
Signed-off-by: Jill Kleven <jill.kleven@pueblolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

C4/SIP/Sip/MsgType.pm
etc/SIPconfig.xml

index d28f1bd..061a255 100644 (file)
@@ -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 ) {
index 49ff852..7a2fd65 100644 (file)
@@ -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') %]" >