related items now returns LI's that may be attached to a selection lists only (no po)
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 3 Apr 2010 20:46:54 +0000 (20:46 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 3 Apr 2010 20:46:54 +0000 (20:46 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16119 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm

index e050fee..6f840d2 100644 (file)
@@ -315,13 +315,12 @@ sub lineitems_related_by_bib {
 
     my $query = {
         "select"=>{"jub"=>["id"]},
-        "from"=>{"jub"=>"acqpo"}, 
+        "from"=>{"jub" => {"acqpo" => {type => 'left'}, "acqpl" => {type => 'left'}}}, 
         "where"=>{
-            "+acqpo"=>{
-                "ordering_agency"=>{
-                    "in"=>$perm_orgs
-                }
-            }
+            '-or' => [
+                { "+acqpo"=>{ "ordering_agency" => $perm_orgs } },
+                { '+acqpl' => { org_unit => $perm_orgs } }
+            ]
         },
         "order_by"=>[{"class"=>"jub", "field"=>"create_time", "direction"=>"desc"}]
     };