# 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}
ItemId => NCIP::Item::Id->new(
{
AgencyId => $selection_ou->shortname(),
- ItemIdentifierValue => $bre->id(),
- ItemIdentifierType => 'SYSNUMBER'
+ ItemIdentifierValue => $itemIdValue,
+ ItemIdentifierType => $itemIdType
}
),
UserId => NCIP::User::Id->new(