Lines 199-205
sub remove_duplicates {
Link Here
|
199 |
my %seen=(); |
199 |
my %seen=(); |
200 |
my $query = "DELETE FROM creator_batches WHERE label_id = ?;"; # ORDER BY timestamp ASC LIMIT ?;"; |
200 |
my $query = "DELETE FROM creator_batches WHERE label_id = ?;"; # ORDER BY timestamp ASC LIMIT ?;"; |
201 |
my $sth = C4::Context->dbh->prepare($query); |
201 |
my $sth = C4::Context->dbh->prepare($query); |
202 |
my @duplicate_items = grep{$seen{$_->{'item_number'}}++} @{$self->{'items'}}; |
202 |
my @duplicate_items = grep{$_->{'item_number'} ? $seen{$_->{'item_number'}}++ : $seen{$_->{'borrower_number'}}++} @{$self->{'items'}}; |
203 |
foreach my $item (@duplicate_items) { |
203 |
foreach my $item (@duplicate_items) { |
204 |
$sth->execute($item->{'label_id'}); |
204 |
$sth->execute($item->{'label_id'}); |
205 |
if ($sth->err) { |
205 |
if ($sth->err) { |
206 |
- |
|
|