Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
}
# If a prefix is submited, we look for the highest itemcallnumber with this prefix, and return it incremented
} elsif ( $code =~ m/^[A-Z.\-]+$/ ) {
}
# If a prefix is submited, we look for the highest itemcallnumber with this prefix, and return it incremented
} elsif ( $code =~ m/^[A-Z.\-]+$/ ) {
my $sth = $dbh->prepare("SELECT MAX(CAST(SUBSTRING_INDEX(itemcallnumber,' ',-1) AS SIGNED)) FROM items WHERE itemcallnumber LIKE ?");
$sth->execute($code.' %');
if ( my $max = $sth->fetchrow ) {
my $sth = $dbh->prepare("SELECT MAX(CAST(SUBSTRING_INDEX(itemcallnumber,' ',-1) AS SIGNED)) FROM items WHERE itemcallnumber LIKE ?");
$sth->execute($code.' %');
if ( my $max = $sth->fetchrow ) {