Bug 7469: (follow-up) update shipment receiving form
[koha_fer] / C4 / Bookseller.pm
index 2471380..f56f4e3 100644 (file)
@@ -98,14 +98,14 @@ sub GetBookSellerFromId {
 
 =head2 GetBooksellersWithLateOrders
 
-%results = GetBooksellersWithLateOrders($delay);
+%results = GetBooksellersWithLateOrders( $delay, $estimateddeliverydatefrom, $estimateddeliverydateto );
 
 Searches for suppliers with late orders.
 
 =cut
 
 sub GetBooksellersWithLateOrders {
-    my ( $delay, $branch, $estimateddeliverydatefrom, $estimateddeliverydateto ) = @_;    # FIXME: Branch argument unused.
+    my ( $delay, $estimateddeliverydatefrom, $estimateddeliverydateto ) = @_;
     my $dbh = C4::Context->dbh;
 
     # FIXME NOT quite sure that this operation is valid for DBMs different from Mysql, HOPING so
@@ -226,6 +226,7 @@ C<&ModBookseller> with the result.
 sub ModBookseller {
     my ($data) = @_;
     my $dbh    = C4::Context->dbh;
+    return unless $data->{'id'};
     my $query  = 'UPDATE aqbooksellers
         SET name=?,address1=?,address2=?,address3=?,address4=?,
             postal=?,phone=?,accountnumber=?,fax=?,url=?,contact=?,contpos=?,
@@ -235,7 +236,7 @@ sub ModBookseller {
             discount=?,notes=?,gstrate=?,deliverytime=?
         WHERE id=?';
     my $sth = $dbh->prepare($query);
-    $sth->execute(
+    return $sth->execute(
         $data->{'name'},         $data->{'address1'},
         $data->{'address2'},     $data->{'address3'},
         $data->{'address4'},     $data->{'postal'},
@@ -253,7 +254,6 @@ sub ModBookseller {
         $data->{deliverytime},
         $data->{'id'}
     );
-    return;
 }
 
 =head2 DelBookseller
@@ -269,8 +269,7 @@ sub DelBookseller {
     my $id  = shift;
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare('DELETE FROM aqbooksellers WHERE id=?');
-    $sth->execute($id);
-    return;
+    return $sth->execute($id);
 }
 
 1;