Skip to content
Browse files

PT16310341: SIP2 differentiation between item-level and title-level h…

…olds

The SIP2 code was essentially forcing a priority hold regardless of whether
it was a title-level or item-level hold.  Altered the code to account for
an item level hold by testing for an itemnumber and non-found status in the
reserves table.  Needed to regain patron info if an item level hold was in
place for an item that was being checked in.
  • Loading branch information...
1 parent a31b83d commit e3cce23ce5cfc33895c314f0b825a445ca1030a5 @dlbptfs dlbptfs committed with ctfliblime Aug 11, 2011
Showing with 6 additions and 3 deletions.
  1. +1 −1 C4/SIP/ILS/Item.pm
  2. +5 −2 C4/SIP/Sip/MsgType.pm
View
2 C4/SIP/ILS/Item.pm
@@ -107,7 +107,7 @@ sub new {
my ($whatever, $arrayref) = GetReservesFromBiblionumber($item->{biblionumber});
$item->{hold_queue} = [ sort priority_sort @$arrayref ];
$item->{hold_shelf} = [( grep { defined $_->{found} and $_->{found} eq 'W' } @{$item->{hold_queue}} )];
- $item->{pending_queue} = [( grep {(! defined $_->{found}) or ($_->{found} ne 'W' and $_->{found} ne 'S') } @{$item->{hold_queue}} )];
+ $item->{pending_queue} = [( grep {(! defined $_->{found} or ($_->{found} ne 'W' and $_->{found} ne 'S')) and ! defined $_->{itemnumber} } @{$item->{hold_queue}} )];
$self = $item;
bless $self, $type;
View
7 C4/SIP/Sip/MsgType.pm
@@ -618,6 +618,7 @@ sub handle_checkin {
my ($current_loc, $inst_id, $item_id, $terminal_pwd, $item_props, $cancel);
my ($patron, $item, $status);
my $resp = CHECKIN_RESP;
+ my $hold_patron_id;
my ($no_block, $trans_date, $return_date) = @{$self->{fixed_fields}};
my $fields = $self->{fields};
@@ -674,6 +675,8 @@ sub handle_checkin {
$resp .= add_field(FID_INST_ID, $inst_id);
$resp .= add_field(FID_ITEM_ID, $item_id);
+ $hold_patron_id = $status->{hold}->{borrowernumber};
+
if ($item) {
$resp .= add_field(FID_PERM_LOCN, $item->permanent_location);
$resp .= maybe_add(FID_TITLE_ID, $item->title_id);
@@ -690,8 +693,8 @@ 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_bcode );
- $resp .= maybe_add(FID_HOLD_PATRON_NAME, $item->hold_patron_name );
+ $resp .= maybe_add(FID_HOLD_PATRON_ID, $item->hold_patron_bcode($hold_patron_id) );
+ $resp .= maybe_add(FID_HOLD_PATRON_NAME, $item->hold_patron_name($hold_patron_id) );
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;
# just me being paranoid.

0 comments on commit e3cce23

Please sign in to comment.
Something went wrong with that request. Please try again.