Bug 10572: Add phone to message_transport_types table for new installs
[koha.git] / C4 / Creators / Batch.pm
index 8df5977..28beeb7 100644 (file)
@@ -9,7 +9,7 @@ use C4::Context;
 use C4::Debug;
 
 BEGIN {
-    use version; our $VERSION = qv('1.0.0_1');
+    use version; our $VERSION = qv('3.07.00.049');
 }
 
 sub _check_params {
@@ -149,6 +149,7 @@ sub retrieve {
     };
     while (my $record = $sth->fetchrow_hashref) {
         $self->{'branch_code'} = $record->{'branch_code'};
+        $self->{'creator'} = $record->{'creator'};
         push (@{$self->{'items'}}, {$number_type => $record->{$number_type}, label_id => $record->{'label_id'}});
         $record_flag = 1;       # true if one or more rows were retrieved
     }
@@ -198,7 +199,11 @@ sub remove_duplicates {
     my %seen=();
     my $query = "DELETE FROM creator_batches WHERE label_id = ?;"; # ORDER BY timestamp ASC LIMIT ?;";
     my $sth = C4::Context->dbh->prepare($query);
-    my @duplicate_items = grep{$seen{$_->{'item_number'}}++} @{$self->{'items'}};
+    my @duplicate_items = grep{
+        $_->{'item_number'}
+            ? $seen{$_->{'item_number'}}++
+            : $seen{$_->{'borrower_number'}}++
+    } @{$self->{'items'}};
     foreach my $item (@duplicate_items) {
         $sth->execute($item->{'label_id'});
         if ($sth->err) {
@@ -304,8 +309,8 @@ This file is part of Koha.
 Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later version.
 
-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.
 
 =head1 DISCLAIMER OF WARRANTY