Generic patron barcode generation (OpenSRF and DB)
Laurentian University needed the ability to generate barcodes as part of
its LDAP integration work, and the first generation (so to speak) of the
was specific to LU - including hard-coded prefixes and database
functions that include the "lu" name.
This commit makes the functionality much more generic and thus more
likely to be able to be adopted by other institutions. The principle
components are:
Database functions:
evergreen.actor_generate_barcode([prefix TEXT]) - returns a 14-digit
barcode from the evergreen.actor_barcode_seq sequence with a prefix of
'AUTOBC' or the specific prefix of up to 6 characters. If the
resulting barcode is all digits, then the 14th character will be a
mod10 check digit; otherwise the 14th digit will be '0'.
evergreen.actor_update_barcode(usr_id INTEGER[, prefix TEXT]) -
generates a new barcode for the specified user, with the optional
barcode prefix.
evergreen.mod10(barcode TEXT) - given a barcode, generates a mod10
check digit and returns the barcode with the appended check digit
OpenSRF method:
open-ils.actor.generate_patron_barcode([usr_id INT[, prefix TEXT]]) -
generates a new barcode for the patron