(bug #4051) add due date in overdue.tmpl
[koha.git] / C4 / Bookseller.pm
index d3e63c7..0153f2b 100644 (file)
@@ -24,6 +24,7 @@ use vars qw($VERSION @ISA @EXPORT);
 BEGIN {
        # set the version for version checking
        $VERSION = 3.01;
+    require Exporter;
        @ISA    = qw(Exporter);
        @EXPORT = qw(
                &GetBookSeller &GetBooksellersWithLateOrders &GetBookSellerFromId
@@ -68,9 +69,9 @@ aqbooksellers table in the Koha database.
 sub GetBookSeller($) {
     my ($searchstring) = @_;
     my $dbh = C4::Context->dbh;
-    my $query = "SELECT * FROM aqbooksellers WHERE name LIKE ?";
+    my $query = "SELECT * FROM aqbooksellers WHERE name LIKE ? ";
     my $sth =$dbh->prepare($query);
-    $sth->execute( "$searchstring%" );
+    $sth->execute( "%$searchstring%");
     my @results;
     # count how many baskets this bookseller has.
     # if it has none, the bookseller can be deleted
@@ -110,7 +111,7 @@ Searches for suppliers with late orders.
 =cut
 
 sub GetBooksellersWithLateOrders {
-    my ($delay,$branch) = @_;
+    my ($delay,$branch) = @_;  # FIXME: Branch argument unused.
     my $dbh   = C4::Context->dbh;
 
 # FIXME NOT quite sure that this operation is valid for DBMs different from Mysql, HOPING so
@@ -195,6 +196,7 @@ sub AddBookseller {
     );
 
     # return the id of this new supplier
+    # FIXME: no protection against simultaneous addition: max(id) might be wrong!
     $query = "
         SELECT max(id)
         FROM   aqbooksellers
@@ -206,9 +208,9 @@ sub AddBookseller {
 
 #-----------------------------------------------------------------#
 
-=head2 ModSupplier
+=head2 ModBookseller
 
-&ModSupplier($bookseller);
+&ModBookseller($bookseller);
 
 Updates the information for a given bookseller. C<$bookseller> is a
 reference-to-hash whose keys are the fields of the aqbooksellers table