Modify NCIP::ILS::Evergreen->requestitem.
[working/NCIPServer.git] / lib / NCIP / ILS / Evergreen.pm
index 70fe5fb..de56fbb 100644 (file)
@@ -1053,8 +1053,14 @@ sub requestitem {
         } else {
             $data->{ItemId} = NCIP::Item::Id->new({
                 ItemIdentifierValue => $item->id(),
-                ItemIdentifierType => 'SYSNUMBER'
-            })
+            });
+            # if we have an $ou, we return the AgencyId, else set
+            # ItemIdentifierType.
+            if ($ou) {
+                $data->{ItemId}->AgencyId($ou->shortname());
+            } else {
+                $data->{ItemId}->ItemIdentifierType('SYSNUMBER');
+            }
         }
 
         # Look for UserElements requested and add it to the response: