To keep things simple, we deflesh the call number of the copy to
be deleted, if it was fleshed earlier, which it was likely to be.
Signed-off-by: Jason Stephenson <jason@sigio.com>
# First, make sure the copy is not already deleted and we own it.
return undef if ($U->is_true($copy->deleted()) || $copy->circ_lib() != $ou_id);
+ # If call_number was fleshed, deflesh it.
+ if (ref($copy->call_number())) {
+ my $cn = $copy->call_number();
+ $copy->call_number($cn->id());
+ }
+
# We need a transaction & connected session.
my $xact;
my $session = OpenSRF::AppSession->create('open-ils.pcrud');