Commit 8a5b8be3 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

ncip: handle compund barcode/rfid strings from bibliofil

parent b0ad6343
......@@ -180,12 +180,21 @@ sub itemshipped {
my @items = $biblio->items();
@items == 1 or die "expected only 1 entry for $biblio_id, got: ".scalar(@items);
my $item = $items[0];
if ($request->{$message}->{ItemId}->{ItemIdentifierType} eq "Barcode") {
my $barcode = $request->{$message}->{ItemId}->{ItemIdentifierValue};
$saved_request->illrequestattributes->find({ type => 'ItemIdentifierType' })->value('Barcode')->store();
$saved_request->illrequestattributes->find({ type => 'ItemIdentifierValue' })->value($barcode)->store();
$item->itemnotes("ILL barcode: " . $barcode);
my @identifier_types = split(";", $request->{$message}->{ItemId}->{ItemIdentifierType});
my @identifiers = split(";", $request->{$message}->{ItemId}->{ItemIdentifierValue});
for ($i=0; $i<@identifier_types; $i++) {
my $id_type = @identifier_types[$i];
my $id = @identifiers[$i];
if ($id_type eq "Barcode") {
$saved_request->illrequestattributes->find({ type => 'ItemIdentifierType' })->value('Barcode')->store();
$saved_request->illrequestattributes->find({ type => 'ItemIdentifierValue' })->value($id)->store();
$item->itemnotes("ILL barcode: " . $barcode);
}
if ($id_type eq "RFID") {
$saved_request->illrequestattributes->find_or_create({ type => 'RFID' })->value($id)->store();
}
}
$item->store;
warn "Setting status to H_ITEMSHIPPED";
$saved_request->status( 'H_ITEMSHIPPED' )->store;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment