From 44152ebf23bdb1f6fef22665f39f15cb6e3119eb Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Sun, 7 Aug 2016 17:52:16 -0400 Subject: [PATCH] Return Item Barcode in RequestItemResponse When a target is successfully targeted handling a RequestItem message, return the barcode of the targeted item. Signed-off-by: Jason Boyer Signed-off-by: Jason Stephenson --- lib/NCIP/ILS/Evergreen.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 85aa440..7d3b676 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -1053,6 +1053,17 @@ sub requestitem { # Add a hold note with the RequestIdentifierValue for later # lookup in CancelRequestItem. We do not care if it fails. $self->create_hold_note($hold, 'NCIP Remote Request ID', $request->{$message}->{RequestId}->{RequestIdentifierValue}); + my ($itemIdType, $itemIdValue) = ('SYSNUMBER', 'BibId-' . $bre->id()); + if ($hold->current_copy) { + my $copy = $U->simplereq( + 'open-ils.pcrud', + 'open-ils.pcrud.retrieve.acp', + $self->{session}->{authtoken}, + $hold->current_copy + ); + $itemIdType = 'Barcode Id'; + $itemIdValue = $copy->barcode(); + } my $data = { RequestId => NCIP::RequestId->new( $request->{$message}->{RequestId} @@ -1060,8 +1071,8 @@ sub requestitem { ItemId => NCIP::Item::Id->new( { AgencyId => $selection_ou->shortname(), - ItemIdentifierValue => $bre->id(), - ItemIdentifierType => 'SYSNUMBER' + ItemIdentifierValue => $itemIdValue, + ItemIdentifierType => $itemIdType } ), UserId => NCIP::User::Id->new( -- 2.43.2