View | Details | Raw Unified | Return to bug 20435
Collapse All | Expand All

(-)a/cataloguing/value_builder/stocknumberAV.pl (-1 / +1 lines)
Lines 85-91 my $launcher = sub { Link Here
85
85
86
    # If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented
86
    # If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented
87
    $code =~ s/ *$//g;
87
    $code =~ s/ *$//g;
88
    if ( $code =~ m/^[A-Z]+$/ ) {
88
    if ( $code =~ m/^[a-zA-Z]+$/ ) {
89
        my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category='INVENTORY' AND authorised_value=?");
89
        my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category='INVENTORY' AND authorised_value=?");
90
        $sth->execute( $code);
90
        $sth->execute( $code);
91
91
(-)a/cataloguing/value_builder/stocknumberam123.pl (-2 / +1 lines)
Lines 86-92 my $launcher = sub { Link Here
86
            );
86
            );
87
        }
87
        }
88
    # If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented
88
    # If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented
89
    } elsif ( $code =~ m/^[A-Z]+$/ ) {
89
    } elsif ( $code =~ m/^[a-zA-Z]+$/ ) {
90
        my $sth = $dbh->prepare("SELECT MAX(CAST(SUBSTRING_INDEX(stocknumber,' ',-1) AS SIGNED)) FROM items WHERE stocknumber LIKE ?");
90
        my $sth = $dbh->prepare("SELECT MAX(CAST(SUBSTRING_INDEX(stocknumber,' ',-1) AS SIGNED)) FROM items WHERE stocknumber LIKE ?");
91
        $sth->execute($code.' %');
91
        $sth->execute($code.' %');
92
        
92
        
93
- 

Return to bug 20435