[open-ils-commits] [GIT] Evergreen ILS branch master updated. 6ceac83b2ba88ffda97a0bc2fb1faa58d6aad7c6
Evergreen Git
git at git.evergreen-ils.org
Mon Apr 2 12:14:27 EDT 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 6ceac83b2ba88ffda97a0bc2fb1faa58d6aad7c6 (commit)
from a25aa4e66ce4080bac65cd702a1e51542d5bae7e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6ceac83b2ba88ffda97a0bc2fb1faa58d6aad7c6
Author: James Fournie <jfournie at sitka.bclibraries.ca>
Date: Wed Feb 29 16:42:10 2012 -0800
Acq - fix cloning of picklists so that all lineitems are cloned with a 'new' state
This prevents duplicated items on purchase orders when the picklists are cloned and
other wacky problems.
Signed-off-by: Mike Rylander <mrylander at gmail.com>
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 0533d50..7272f63 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
@@ -2186,19 +2186,22 @@ sub clone_picklist_api {
my $li_ids = $e->search_acq_lineitem({picklist => $pl_id}, {idlist => 1});
+ # get the current user
+ my $cloner = $mgr->editor->requestor->id;
+
for my $li_id (@$li_ids) {
- # copy the lineitems
- my $li = $e->retrieve_acq_lineitem($li_id);
- my $new_li = create_lineitem($mgr, %{$li->to_bare_hash}, picklist => $new_pl->id) or return $e->die_event;
+ # copy the lineitems' MARC
+ my $marc = ($e->retrieve_acq_lineitem($li_id))->marc;
- my $lid_ids = $e->search_acq_lineitem_detail({lineitem => $li_id}, {idlist => 1});
- for my $lid_id (@$lid_ids) {
+ # create a skeletal clone of the item
+ my $li = Fieldmapper::acq::lineitem->new;
+ $li->creator($cloner);
+ $li->selector($cloner);
+ $li->editor($cloner);
+ $li->marc($marc);
- # copy the lineitem details
- my $lid = $e->retrieve_acq_lineitem_detail($lid_id);
- create_lineitem_detail($mgr, %{$lid->to_bare_hash}, lineitem => $new_li->id) or return $e->die_event;
- }
+ my $new_li = create_lineitem($mgr, %{$li->to_bare_hash}, picklist => $new_pl->id) or return $e->die_event;
$mgr->respond;
}
-----------------------------------------------------------------------
Summary of changes:
.../perlmods/lib/OpenILS/Application/Acq/Order.pm | 21 +++++++++++--------
1 files changed, 12 insertions(+), 9 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list