<<

NAME

update_patrons_category.pl - Given a set of parameters update selected patrons from one catgeory to another. Options are cumulative.

SYNOPSIS

update_patrons_category.pl -f=categorycode -t=categorycode [-b=branchcode] [--too_old] [--too_young] [-fo=X] [-fu=X] [-rb=date] [-ra=date] [-v] [--field column=value ...]

update_patrons_category.pl --help | --man

Options: --help brief help message --man full documentation -too_old update if over maximum age for current category -too_young update if under minimuum age current category -fo=X --fineover=X update if fines over X amount -fu=X --fineunder=X update if fines under X amount -rb=date --regbefore update if registration date is before given date -ra=date --regafter update if registration date is after a given date -d --field name=value where <name> is a column in the borrowers table, patrons will be updated if the field is equal to given <value> --where <conditions> where clause to add to the query -v -verbose verbose mode -c --confirm commit changes to db, no action will be taken unless this switch is included -b --branch <branchname> only deal with patrons from this library/branch -f --from <categorycode> change patron category from this category -t --to <categorycode> change patron category to this category

OPTIONS

--help

Print a brief help message and exits.

--man

Prints the manual page and exits.

--verbose | -v

Verbose. Without this flag set, only fatal errors are reported.

--confirm | -c

Commit changes. Unless this flag set is, the script will report changes but not actually execute them on the database.

--branch | -b

changes patrons for one specific branch. Use the value in the branches.branchcode table.

--from | -f

*required* defines the category to update. Expects the code from categories.categorycode.

--to | -t

*required* defines the category patrons will be converted to. Expects the code from categories.categorycode.

--too_old

Update patron only if they are above the maximum age range specified for the 'from' category.

--too_young

Update patron only if they are below the minimum age range specified for the 'from' category.

--fineover=X | -fo=X

Supply a number and only account with fines over this number will be updated.

--fineunder=X | -fu=X

Supply a number and only account with fines under this number will be updated.

--regbefore=date | -rb=date

Enter a date in ISO format YYYY-MM-DD and only patrons registered before this date wil be updated.

--regafter=date | -ra=date

Enter a date in ISO format YYYY-MM-DD and only patrons registered after this date wil be updated.

--field column=value | -d column=value

Use this flag to specify a column in the borrowers table and update only patrons whose value in that column equals the value supplied (repeatable) A value of null will check for a field that is not set.

e.g. --field dateexpiry=2016-01-01 will update all patrons who expired on that date, useful for schools etc.

--where $conditions

Use this option to specify a condition built with columns from the borrowers table

e.g. --where 'email IS NULL' will update all patrons with no value for email

--where 'categorycode LIKE "%CHILD"' will update all patrons with a category ending in CHILD.

--where 'categorycode LIKE RESIDENT%' will update all patrons whose category does not begin with RESIDENT.

DESCRIPTION

This script is designed to update patrons from one category to another.

USAGE EXAMPLES

update_patron_categories.pl - Suggests that you read this help. :)

update_patron_categories.pl -b=<branchcode> -f=<categorycode> -t=<categorycode> --confirm - Processes a single branch, and updates the patron categories from fromcat to tocat.

update_patron_categories.pl -b=<branchcode> -f=<categorycode> -t=<categorycode> --too_old --confirm - Processes a single branch, and updates the patron categories from fromcat to tocat for patrons over the age range of fromcat.

update_patron_categories.pl -f=<categorycode> -t=<categorycode> -v - Processes all branches, shows all messages, and reports the patrons who would be affected. Takes no action on the database.

<<