No subject


Wed Nov 11 03:01:06 NZDT 2009


"default the card number field on the patron addition screen to the
next available card number (for example, if the largest currently used
card number is 26345000012941, then this field will default to
26345000012942)."

my $sth = $dbh->prepare(
            "select max(cast(cardnumber as signed)) from borrowers"
        );
        $sth->execute;
        my ($result) = $sth->fetchrow;
        return $result + 1

So to start the largest is null == 0, the next largest is 1, so away it goes.

If however you have check digit switched on, it will do something
funkier to build cardnumbers. But 99.9% of people won't do that.

Chris


More information about the Koha mailing list