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

--- Comment #6 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 206847
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206847&action=edit
Bug 43544: (follow-up) Don't shorten a membership when updating the expiration
date

--update-expiry always overwrote the expiration date with today plus the new
category's enrollment period. If a patron already expired further out than
that,
the category change pulled their expiration date backwards.

A library that gives youth cards an 18 year enrollment period has patrons
expiring in 2044. Moving those patrons into an adult category with a 36 month
enrollment period would have cut fifteen years off their cards.

This patch only writes the new date when it is later than the one the patron
already has, so aging a patron up can extend a membership but never shorten it.

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 216 months
3) Create a patron category ADULT, category type adult, with an enrollment
   period of 36 months
4) Create two patrons in YOUTH, both with a date of birth making them 18 or
   older, one expiring in 2044 and one expiring in the past
5) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --too_old
--update-expiry -v --confirm
6) Note the patron who expired in the past is now in ADULT and expires 36
   months from today!
7) Note the patron expiring in 2044 is now in ADULT and still expires in 2044!
8) prove t/db_dependent/Patrons.t

Sponsored-by: ByWater Solutions

-- 
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