X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;ds=sidebyside;f=C4%2FBarcodes%2FValueBuilder.pm;h=479a4360f88da209d9bd550afcac0a95b6388b04;hb=b168f4a2e9a03ed56ce857353d4dde940980caba;hp=81747dee674a7bd0dd095347cc2d3d78d8db09cb;hpb=55127d50fb0a00f70d5de06dee76ddfad54bd094;p=srvgit diff --git a/C4/Barcodes/ValueBuilder.pm b/C4/Barcodes/ValueBuilder.pm index 81747dee67..479a4360f8 100644 --- a/C4/Barcodes/ValueBuilder.pm +++ b/C4/Barcodes/ValueBuilder.pm @@ -19,6 +19,8 @@ # along with Koha; if not, see . package C4::Barcodes::ValueBuilder::incremental; + +use Modern::Perl; use C4::Context; my $DEBUG = 0; @@ -89,7 +91,7 @@ sub get_barcode { my $nextnum; my $query = "select max(cast( substring_index(barcode, '-',-1) as signed)) from items where barcode like ?"; my $sth=C4::Context->dbh->prepare($query); - $sth->execute("$args->{year}%"); + $sth->execute($args->{year} . '-%'); while (my ($count)= $sth->fetchrow_array) { warn "Examining Record: $count" if $DEBUG; $nextnum = $count if $count;