[open-ils-commits] r8932 - branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Mar 8 20:53:37 EST 2008


Author: erickson
Date: 2008-03-08 20:20:46 -0500 (Sat, 08 Mar 2008)
New Revision: 8932

Modified:
   branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
Log:
fixed lineitem retrieval call for LIs that do not have the requested sort attr.  sorting non-attr items to the bottom.

Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2008-03-09 01:12:03 UTC (rev 8931)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2008-03-09 01:20:46 UTC (rev 8932)
@@ -509,11 +509,17 @@
     $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([



More information about the open-ils-commits mailing list