<event code='1881' textcode='PERMISSION_GRP_PENALTY_THRESHOLD_NOT_FOUND'>
<desc xml:lang='en-US'>The requested permission_grp_penalty_threshold was not found</desc>
</event>
-
+ <event code='1882' textcode='RECORD_REFERENCED_BY_LINEITEM'>
+ <desc xml:lang="en-US">The selected bib record has an open lineitem order referencing it.</desc>
+ </event>
<event code='1700' textcode='NON_CAT_TYPE_EXISTS'>
<desc xml:lang="en-US"> The non-cataloged type object already exists </desc>
return $e->die_event unless $e->allowed('DELETE_RECORD', $e->requestor->ws_ou);
my $vols = $e->search_asset_call_number({record=>$rec_id, deleted=>'f'});
return OpenILS::Event->new('RECORD_NOT_EMPTY', payload=>$rec_id) if @$vols;
+ my $acq_li_count = $e->json_query({
+ select => {jub => [{column => 'id', transform => 'count'}]},
+ from => 'jub',
+ where => {
+ '+jub' => {
+ eg_bib_id => $rec_id,
+ state => ['new','pending-order','on-order']
+ }
+ }
+ })->[0];
+ return OpenILS::Event->new('RECORD_REFERENCED_BY_LINEITEM', payload => $rec_id) if ($acq_li_count->{id} > 0);
my $evt = OpenILS::Application::Cat::BibCommon->delete_rec($e, $rec_id);
if($evt) { $e->rollback; return $evt; }
$e->commit;