this patch fix the searchorder function, and add to the SQL query a "AND 
biblionumber" statement if a biblionumber is speficied.
Sometimes C4::Acquisitions::searchorder() find more than one result, so the 
user is looping to the same page to choose the great record, adding a contraint 
to biblionumber allows to be more strict.
---
 C4/Acquisition.pm |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm
index ee7b384..9888dc1 100644
--- a/C4/Acquisition.pm
+++ b/C4/Acquisition.pm
@@ -720,6 +720,12 @@ sub SearchOrder {
           )
           . ") or biblioitems.isbn=? OR (aqorders.ordernumber=? AND 
aqorders.biblionumber=?)) ";
     }
+    
+    if( $biblionumber and $biblionumber ne "" ){
+        $query .= "AND aqorders.biblionumber = ? ";
+        push (@searchterms, $biblionumber);
+    }
+    
     $query .= " GROUP BY aqorders.ordernumber";
     ### $query
     my $sth = $dbh->prepare($query);
-- 
1.6.0.4

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to