On 24 February 2010 08:10, Nicole Engard <nengard@gmail.com> wrote:
Becki - thanks for all of that!!
My question is not so much where do barcodes come from - but how is it that my Koha knows what the next barcode is - who gave it the first barcode to calculate all the others based on? It wasn't me - and if it was I didn't realize I was doing it ;)
It only assigns you barcodes if you switch that option on. Most libraries I have worked with get pre printed cards, and scan them in when registering a borrower. If you have autoMemberNum on, it will start at 1 and work up, theres nothing much more to it than that.
From the sysprefs "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