]> git.evergreen-ils.org Git - contrib/Conifer.git/commit
Generic patron barcode generation (OpenSRF and DB)
authorDan Scott <dscott@laurentian.ca>
Thu, 10 Jan 2013 19:17:33 +0000 (14:17 -0500)
committerDan Scott <dscott@laurentian.ca>
Fri, 20 Apr 2018 16:51:36 +0000 (12:51 -0400)
commit6fb4c0d5e90cd55163c45675a184d41d3ba69e22
treeeeb4231606c4b742b21106f3230072cca917731f
parentf33b47f8c6e604c2cba421d424970a286bf852bc
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

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
Open-ILS/src/sql/Pg/upgrade/XXXX.generate_patron_barcodes.sql [new file with mode: 0644]