}]},
from => 'acp',
where => {call_number => $cn_id}
- });
+ })->[0];
my $target_cn;
my $evt;
# We are transferring all attached copies to the matching
# callnumber on the target bib. This call number is no
# longer needed. Delete it.
- $cn->deleted('t');
- $cn->edit_date('now');
- $cn->editor($e->requestor->id);
- $e->update_asset_call_number($cn) or return $e->die_event;
+ $evt = OpenILS::Application::Cat::AssetCommon->delete_volume(
+ $e, $cn,
+ 1, # override
+ 0, # delete copies
+ 1 # skip copy checks
+ );
+
+ return $evt if $evt;
} else {
# No matching CN exists. Point our CN at the target bib.
}
}
+ # Copies need to be migrated to the target call number.
+
($target_cn, $evt) =
OpenILS::Application::Cat::AssetCommon->find_or_create_volume(
$e, $cn->label, $bib_id, $cn->owning_lib,
# ... transfer copies.
# Transfer order copies to the new call number.
- for my $copy ($cn_copies) {
+ for my $copy (@$cn_copies) {
$copy->call_number($target_cn->id);
$copy->edit_date('now');
$copy->editor($e->requestor->id);