https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43544

--- Comment #4 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 206845
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206845&action=edit
Bug 43544: Add ability to update patron expiration dates when changing their
category

Some libraries expire youth cards on the patron's 18th birthday, then use
update_patrons_category.pl to move those patrons into an adult category once
they age out. Right now the cron only changes the category, so the patron
lands in the adult category still carrying the youth expiration date, and is
expired the moment they get there.

The staff interface already asks about this. Changing a patron's category
there pops up "Patron category changed" with a "Reset expiration date to
category default" checkbox, but the cron has no equivalent.

This patch adds a --update-expiry switch. When it is passed, each updated
patron also gets the expiration date the new category gives a patron enrolled
today, which is the same date the staff interface offers.

Test Plan:
1) Apply this patch
2) Create a patron category YOUTH, category type child, with an upper age
   limit of 17 and an enrollment period of 12 months
3) Create a patron category ADULT, category type adult, with an enrollment
   period of 36 months
4) Create a patron in YOUTH with a date of birth making them 18 or older, and
   an expiration date in the past
5) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --too_old -v
--confirm
6) Note the patron is now in ADULT but still has the old expiration date
7) Set the patron back to YOUTH with the old expiration date
8) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --too_old
--update-expiry -v
9) Note the output says the expiration date will be set to 36 months from
   today, and that nothing was changed because this is test mode
10) Run the same command again, adding --confirm
11) Note the patron is in ADULT and expires 36 months from today!
12) Set the patron back to YOUTH with the old expiration date
13) Repeat step 5 and note the expiration date is left alone without the
    switch!

Sponsored-by: ByWater Solutions

Signed-off-by: Kyle M Hall <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to