$lid->recv_time('now');
$e->update_acq_lineitem_detail($lid) or return 0;
- my $copy = $e->retrieve_asset_copy($lid->eg_copy_id) or return 0;
- $copy->status(OILS_COPY_STATUS_IN_PROCESS);
- $copy->edit_date('now');
- $copy->editor($e->requestor->id);
- $copy->creator($e->requestor->id) if $U->ou_ancestor_setting_value(
- $e->requestor->ws_ou, 'acq.copy_creator_uses_receiver', $e);
- $e->update_asset_copy($copy) or return 0;
+ if ($lid->eg_copy_id) {
+ my $copy = $e->retrieve_asset_copy($lid->eg_copy_id) or return 0;
+ $copy->status(OILS_COPY_STATUS_IN_PROCESS);
+ $copy->edit_date('now');
+ $copy->editor($e->requestor->id);
+ $copy->creator($e->requestor->id) if $U->ou_ancestor_setting_value(
+ $e->requestor->ws_ou, 'acq.copy_creator_uses_receiver', $e);
+ $e->update_asset_copy($copy) or return 0;
+ }
$mgr->add_lid;
$lid->clear_recv_time;
$e->update_acq_lineitem_detail($lid) or return 0;
- my $copy = $e->retrieve_asset_copy($lid->eg_copy_id) or return 0;
- $copy->status(OILS_COPY_STATUS_ON_ORDER);
- $copy->edit_date('now');
- $copy->editor($e->requestor->id);
- $e->update_asset_copy($copy) or return 0;
+ if ($lid->eg_copy_id) {
+ my $copy = $e->retrieve_asset_copy($lid->eg_copy_id) or return 0;
+ $copy->status(OILS_COPY_STATUS_ON_ORDER);
+ $copy->edit_date('now');
+ $copy->editor($e->requestor->id);
+ $e->update_asset_copy($copy) or return 0;
+ }
$mgr->add_lid;
return $lid;