X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=C4%2FCreators%2FBatch.pm;h=28beeb7ed674bd0c83849084be061e4e7687c23c;hb=9ebb6ba5d1a308816bb1cad57a59262a3a053ace;hp=8df5977aed31014ac2ba3df082b94fe7be411d01;hpb=8e0b1fe58f7e4f6e595b18d43c939c203833dac1;p=koha.git diff --git a/C4/Creators/Batch.pm b/C4/Creators/Batch.pm index 8df5977aed..28beeb7ed6 100644 --- a/C4/Creators/Batch.pm +++ b/C4/Creators/Batch.pm @@ -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