Signed-off-by: Bill Erickson <berickxx@gmail.com>
$e, $bib_id, $cn->label, $cn->owning_lib, $cn->prefix, $cn->suffix
);
- if (!$target_cn) {
+ if ($target_cn) {
+ # 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;
+
+ } else {
# No matching CN exists. Point our CN at the target bib.
$cn->record($bib_id);
$cn->edit_date('now');