LP#1619703 Transfer ACQ lineitem to alternate bib WIP
authorBill Erickson <berickxx@gmail.com>
Thu, 6 Oct 2016 14:24:06 +0000 (10:24 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 17 Mar 2017 14:57:22 +0000 (10:57 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm

index b613177..622d1e0 100644 (file)
@@ -4285,7 +4285,16 @@ sub transfer_order_volume {
             $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');