Default ACQ copies use workstation org as owning lib
authorBill Erickson <berick@esilibrary.com>
Mon, 4 Feb 2013 20:46:20 +0000 (15:46 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 11 Mar 2013 13:08:35 +0000 (09:08 -0400)
When creating default copies for new lineitems or lineitems added to
POs, use the workstation org unit as the owning lib for each copy.  With
this, it's possible to order items for "here" without having to edit any
single copies.  This also resolves a confusing issue where opening the
copies in the copies grid made it appear that each copy had an
owning_lib applied (via the autofieldwidget) when none was yet set.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm

index e41690e..9fe3ae6 100644 (file)
@@ -69,6 +69,7 @@ sub create_lineitem {
         for (1 .. $po->provider->default_copy_count) {
             my $lid = Fieldmapper::acq::lineitem_detail->new;
             $lid->lineitem($li->id);
+            $lid->owning_lib($e->requestor->ws_ou);
             $e->create_acq_lineitem_detail($lid) or return $e->die_event;
         }
     }
index 4f899b7..8ec6538 100644 (file)
@@ -1842,7 +1842,10 @@ sub apply_default_copies {
         next if @$lid_ids;
 
         for (1 .. $copy_count) {
-            create_lineitem_detail($mgr, lineitem => $li_id) or return 0;
+            create_lineitem_detail($mgr, 
+                lineitem => $li_id,
+                owning_lib => $e->requestor->ws_ou
+            ) or return 0;
         }
     }