From: erickson Date: Sun, 9 Mar 2008 01:20:46 +0000 (+0000) Subject: fixed lineitem retrieval call for LIs that do not have the requested sort attr. ... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e0497d686e21bcfeaea6653218c3d015dd53dbe3;p=Evergreen.git fixed lineitem retrieval call for LIs that do not have the requested sort attr. sorting non-attr items to the bottom. git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8932 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm index 84e7cc5d96..d0e8daea99 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm @@ -509,11 +509,17 @@ sub retrieve_pl_lineitem { $PL_ENTRY_JSON_QUERY->{offset} = $offset; my $entries = $e->json_query($PL_ENTRY_JSON_QUERY); - return [] unless $entries and @$entries; my @ids; push(@ids, $_->{id}) for @$entries; + + # collect lineitems that don't have the requested sort attr + my $other_entries = $e->search_acq_lineitem( + {id => {'not in' => [@ids]}, picklist=>$picklist_id},{idlist=>1}); + push(@ids, $_) for @$other_entries; + return \@ids if $$options{idlist}; + return [] unless @ids; if($$options{flesh_attrs}) { $entries = $e->search_acq_lineitem([