Bug 2505 - Add commented use warnings where missing in *.pm
[koha.git] / C4 / Bookseller.pm
index e19378e..bdc4346 100644 (file)
@@ -13,11 +13,12 @@ package C4::Bookseller;
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
+#use warnings; FIXME - Bug 2505
 
 use vars qw($VERSION @ISA @EXPORT);
 
@@ -71,7 +72,7 @@ sub GetBookSeller($) {
     my $dbh = C4::Context->dbh;
     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
@@ -87,7 +88,7 @@ sub GetBookSeller($) {
 
 
 sub GetBookSellerFromId($) {
-       my ($id) = shift or return undef;
+       my $id = shift or return;
        my $dbh = C4::Context->dbh();
        my $query = "SELECT * FROM aqbooksellers WHERE id = ?";
        my $sth =$dbh->prepare($query);
@@ -96,9 +97,9 @@ sub GetBookSellerFromId($) {
                my $sth2 = $dbh->prepare("SELECT count(*) FROM aqbasket WHERE booksellerid=?");
                $sth2->execute($id);
                $data->{basketcount}=$sth2->fetchrow();
-               return ($data);
+               return $data;
        }
-       return 0;
+       return;
 }
 #-----------------------------------------------------------------#
 
@@ -172,10 +173,10 @@ sub AddBookseller {
                 postal,    phone,         fax,        url,           contact,
                 contpos,   contphone,     contfax,    contaltphone,  contemail,
                 contnotes, active,        listprice,  invoiceprice,  gstreg,
-                listincgst,invoiceincgst, specialty,  discount,      invoicedisc,
-                nocalc,    notes
+                listincgst,invoiceincgst,   discount,
+                notes
             )
-        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
+        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
     ";
     my $sth = $dbh->prepare($query);
     $sth->execute(
@@ -190,9 +191,7 @@ sub AddBookseller {
         $data->{'active'},       $data->{'listprice'},
         $data->{'invoiceprice'}, $data->{'gstreg'},
         $data->{'listincgst'},   $data->{'invoiceincgst'},
-        $data->{'specialty'},    $data->{'discount'},
-        $data->{'invoicedisc'},  $data->{'nocalc'},
-        $data->{'notes'}
+        $data->{'discount'},     $data->{'notes'}
     );
 
     # return the id of this new supplier
@@ -208,9 +207,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
@@ -218,8 +217,8 @@ in the Koha database. It must contain entries for all of the fields.
 The entry to modify is determined by C<$bookseller-E<gt>{id}>.
 
 The easiest way to get all of the necessary fields is to look up a
-book seller with C<&booksellers>, modify what's necessary, then call
-C<&ModSupplier> with the result.
+book seller with C<&GetBookseller>, modify what's necessary, then call
+C<&ModBookseller> with the result.
 
 =cut
 
@@ -232,8 +231,8 @@ sub ModBookseller {
             postal=?,phone=?,fax=?,url=?,contact=?,contpos=?,
             contphone=?,contfax=?,contaltphone=?,contemail=?,
             contnotes=?,active=?,listprice=?, invoiceprice=?,
-            gstreg=?, listincgst=?,invoiceincgst=?,
-            specialty=?,discount=?,invoicedisc=?,nocalc=?, notes=?
+            gstreg=?,listincgst=?,invoiceincgst=?,
+            discount=?, notes=?, gstrate=?
         WHERE id=?
     ";
     my $sth    = $dbh->prepare($query);
@@ -249,9 +248,9 @@ sub ModBookseller {
         $data->{'active'},       $data->{'listprice'},
         $data->{'invoiceprice'}, $data->{'gstreg'},
         $data->{'listincgst'},   $data->{'invoiceincgst'},
-        $data->{'specialty'},    $data->{'discount'},
-        $data->{'invoicedisc'},  $data->{'nocalc'},
-        $data->{'notes'},        $data->{'id'}
+        $data->{'discount'},
+        $data->{'notes'},        $data->{'gstrate'},
+        $data->{'id'}
     );
     $sth->finish;
 }