Lines 89-95
sub get_barcode {
Link Here
|
89 |
my $nextnum; |
89 |
my $nextnum; |
90 |
my $query = "select max(cast( substring_index(barcode, '-',-1) as signed)) from items where barcode like ?"; |
90 |
my $query = "select max(cast( substring_index(barcode, '-',-1) as signed)) from items where barcode like ?"; |
91 |
my $sth=C4::Context->dbh->prepare($query); |
91 |
my $sth=C4::Context->dbh->prepare($query); |
92 |
$sth->execute("$args->{year}%"); |
92 |
$sth->execute($args->{year} . '-%'); |
93 |
while (my ($count)= $sth->fetchrow_array) { |
93 |
while (my ($count)= $sth->fetchrow_array) { |
94 |
warn "Examining Record: $count" if $DEBUG; |
94 |
warn "Examining Record: $count" if $DEBUG; |
95 |
$nextnum = $count if $count; |
95 |
$nextnum = $count if $count; |