From c8f1aec1de9115106dffaff9c88d41821ff5695e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 4 Feb 2013 15:46:20 -0500 Subject: [PATCH] Default ACQ copies use workstation org as owning lib 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 Signed-off-by: Kathy Lussier --- .../src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm | 1 + Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm index e41690eafd..9fe3ae639b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm @@ -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; } } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index 4f899b7f77..8ec653894e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -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; } } -- 2.43.2