Lines 49-55
sub get_barcode {
Link Here
|
49 |
my $month = $args->{mon}; |
49 |
my $month = $args->{mon}; |
50 |
my $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?"; |
50 |
my $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?"; |
51 |
my $sth = C4::Context->dbh->prepare($query); |
51 |
my $sth = C4::Context->dbh->prepare($query); |
52 |
$sth->execute("^[-a-zA-Z]{1,}$year$month"); |
52 |
$sth->execute("^[-a-zA-Z0-9]{1,}$year$month"); |
53 |
while (my ($count)= $sth->fetchrow_array) { |
53 |
while (my ($count)= $sth->fetchrow_array) { |
54 |
$nextnum = $count if $count; |
54 |
$nextnum = $count if $count; |
55 |
$nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 9999 items per month |
55 |
$nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 9999 items per month |
56 |
- |
|
|