From c4d833148d1697523b27b377e6e7589ab1394258 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Sun, 6 Sep 2009 10:53:21 +0100 Subject: [PATCH] Return barcode as Sip hold_patron_id Behave consistently with other patron_ids as many sip clients use this in a subsequent patron information or patron status request Signed-off-by: Galen Charlton --- C4/SIP/ILS/Item.pm | 13 +++++++++++++ C4/SIP/Sip/MsgType.pm | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 7e6fac9edb..2e02c63e80 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -175,6 +175,19 @@ sub hold_patron_name { # $self->{hold_patron_name} = $name; # TODO: consider caching return $name; } + +sub hold_patron_bcode { + my $self = shift or return; + my $borrowernumber = (@_ ? shift: $self->hold_patron_id()) or return; + my $holder = GetMember($borrowernumber, 'borrowernumber'); + if ($holder) { + if ($holder->{cardnumber}) { + return $holder->{cardnumber}; + } + } + return; +} + sub destination_loc { my $self = shift or return; my $hold = $self->next_hold(); diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm index f04d162073..67ccc218c2 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -676,7 +676,7 @@ sub handle_checkin { $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 .= maybe_add(FID_HOLD_PATRON_ID, $item->hold_patron_id ); + $resp .= maybe_add(FID_HOLD_PATRON_ID, $item->hold_patron_bcode ); $resp .= maybe_add(FID_HOLD_PATRON_NAME, $item->hold_patron_name ); if ($status->hold and $status->hold->{branchcode} ne $item->destination_loc) { warn 'SIP hold mismatch: $status->hold->{branchcode}=' . $status->hold->{branchcode} . '; $item->destination_loc=' . $item->destination_loc; -- 2.11.0