Bug 17168: Add a command line script for updating patron category based on status
authorNick Clemens <nick@bywatersolutions.com>
Wed, 15 Feb 2017 16:34:04 +0000 (16:34 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 25 Oct 2019 12:19:47 +0000 (13:19 +0100)
commitaf15cbbe1b470110f9e3e901a5e8d56153f10dfe
treea8f39c187a664389e6df87ec277935d3f9eaf74d
parent70a59fc694866154fce74eeaf08ee2126f34947f
Bug 17168: Add a command line script for updating patron category based on status

This patch adds a new script update_patrons_category.pl which allows for
updating patron categories in a batch upon meeting provided criteria.
This script additionally can replace j2a.pl.

To test:
1 - perl update_patrons_category.pl -h
2 - Ensure help text makes sense and covers all options
3 - Test converting patrons supplying only fromcat and tocat
    perl update_patrons_category.pl -f PT -t J -v --confirm
    perl update_patrons_category.pl -f J -t PT -v --confirm
4 - All patrons should have been switched to and from Juveniles
5 - Try without --confirm switch
    perl update_patrons_category.pl -f PT -t J -v
6 - Should list all patrons but not update
7 - Set the age for juvenile patrons to be outside the range provided in
categories (or set the upper age limit for juveniles to '2')
8 - Test with verbosity and with without --confirm
    perl update_patrons_category.pl -f J -a -t PT -v
    perl update_patrons_category.pl -f J -a -t PT -v --confirm
9 - Repeat above and verify linked/unlinked guarantors are removed in above scenario
10 - Test various fine and registration limits
11 - Test matching on specific fields i.e. --field surname=acosta
12 - Sign off

Sponsored by: Round Rock Public Library
(https://www.roundrocktexas.gov/departments/library/)
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Patrons.pm
misc/cronjobs/update_patrons_category.pl [new file with mode: 0644]
t/db_dependent/Patrons.t