007-SIP-hold_pickup.patch

This patch modifies the SIP return message on item information request for holds.

It generates a pickup number based on reserve_id and waitingdate, and prepends to title

diff --git a/MsgType.pm b/lib/C4/SIP/Sip/MsgType.pm
index a95facc..af9cb06 100644
--- a/MsgType.pm
+++ b/lib/C4/SIP/Sip/MsgType.pm
@@ -1171,6 +1171,17 @@ sub handle_item_information {
             $resp .= add_field( FID_HOLD_PICKUP_DATE, timestamp($i) );
         }
 
+        # Deichman mod: prepend title with pickup id if it is marked hold_shelf
+        if ( scalar @{ $item->hold_shelf } > 0 ) {
+            # Need waitingdate and reserve_id for pickup id
+            use C4::Reserves qw( GetReservesFromItemnumber );
+            my ( undef, undef, undef, $reserve_id, $waitingdate ) = GetReservesFromItemnumber($item->{'itemnumber'});
+            # Format dd/mm/yy
+            my ($y, $m, $d) = "2015-10-01" =~ /(\d{4})-(\d{2})-(\d{2})/;
+            my $title = "($d/$m/$y/$reserve_id) - " . $item->title_id; 
+            $resp .= add_field( FID_TITLE_ID, $title );
+        }
+
         $resp .= maybe_add( FID_SCREEN_MSG, $item->screen_msg, $server );
         $resp .= maybe_add( FID_PRINT_LINE, $item->print_line );
     }

Add patch for SIP server to add pickup number to holds
DEICH-117: Add patch for SIP server to add pickup number to holds
