[Bug 32459] New: Add option to expire patrons who were updated in the update_patrons.pl cron job
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Bug ID: 32459 Summary: Add option to expire patrons who were updated in the update_patrons.pl cron job Change sponsored?: --- Product: Koha Version: 22.05 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: bwsdonna@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com A common use of the update_patrons.pl is to update a child card to an adult account. It would be really helpful to be able to expire the account when the patron category is changed. The reason behind this specific situation is when patrons become "adults" libraries need to get a new application form signed, so the individual is now responsible for the account. Perhaps there can be a way to set the expiration date to the current date when those accounts are updated? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Patrons |Command-line Utilities Version|22.05 |master CC| |robin@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Iina Niemi <iina.niemi@turku.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |iina.niemi@turku.fi --- Comment #1 from Iina Niemi <iina.niemi@turku.fi> --- There's no comments in this, I wonder if this is something that could be looked into? We would find it quite useful, if other things could be updated while running this cron too. For example a message could be added to the message field when the cron is run. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43544 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Sponsorship status|--- |Sponsored Comma delimited| |ByWater Solutions list of Sponsors| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 206542 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206542&action=edit Bug 32459: Add ability to expire patrons when their category is changed A common use of update_patrons_category.pl is to move a child card to an adult account. When that happens some libraries need a new application form signed, because the patron is now responsible for the account themselves, so the card should stop working until they come in and sign it. Right now the cron only changes the category. There is no way to have it expire the accounts it touched, and expiring them afterwards by hand or with a report catches patrons the category change never touched. This patch adds an --expire switch. When it is passed, each updated patron gets an expiration date of yesterday, so they are expired as soon as their category changes. It can't be combined with --update-expiry, which sets the expiration date from the new category instead. 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 future 5) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --too_old --expire -v 6) Note the output says the expiration date will be set to yesterday, and that nothing was changed because this is test mode 7) Run the same command again, adding --confirm 8) Note the patron is now in ADULT and shows as expired! 9) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --update-expiry --expire --confirm 10) Note the script tells you the two switches can't be used together! Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 206543 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206543&action=edit Bug 32459: Add unit tests Test Plan: 1) Apply this patch 2) prove t/db_dependent/Patrons.t Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amitddng135@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206542|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206543|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 206849 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206849&action=edit Bug 32459: Add ability to expire patrons when their category is changed A common use of update_patrons_category.pl is to move a child card to an adult account. When that happens some libraries need a new application form signed, because the patron is now responsible for the account themselves, so the card should stop working until they come in and sign it. Right now the cron only changes the category. There is no way to have it expire the accounts it touched, and expiring them afterwards by hand or with a report catches patrons the category change never touched. This patch adds an --expire switch. When it is passed, each updated patron gets an expiration date of yesterday, so they are expired as soon as their category changes. It can't be combined with --update-expiry, which sets the expiration date from the new category instead. 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 future 5) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --too_old --expire -v 6) Note the output says the expiration date will be set to yesterday, and that nothing was changed because this is test mode 7) Run the same command again, adding --confirm 8) Note the patron is now in ADULT and shows as expired! 9) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --update-expiry --expire --confirm 10) Note the script tells you the two switches can't be used together! Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #5 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 206850 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206850&action=edit Bug 32459: Add unit tests Test Plan: 1) Apply this patch 2) prove t/db_dependent/Patrons.t Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #6 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 206851 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206851&action=edit Bug 32459: (follow-up) --expire should still expire patrons after Bug 43544 follow-up The Bug 43544 follow-up made update_category_to only write the new expiration date when it is later than the one the patron already has, so that --update-expiry never shortens a membership. --expire goes through the same code, and yesterday is never later than a patron's current expiration date, so --expire stopped doing anything. This patch applies the "never shorten" check to --update-expiry only. --expire always sets the expiration date to yesterday, as before. The verbose output for --expire no longer says the date only applies to patrons expiring before then. Test Plan: 1) Apply this patch 2) prove t/db_dependent/Patrons.t 3) Note all tests pass! 4) Create a patron category YOUTH, category type child, with an upper age limit of 17 5) Create a patron category ADULT, category type adult 6) Create a patron in YOUTH with a date of birth making them 18 or older, and an expiration date next year 7) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --too_old --expire -v --confirm 8) Note the patron is now in ADULT and expired yesterday! Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43544 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43544 [Bug 43544] update_patrons.pl cron should have a flag for updating the expiration to match the new category when changing category -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206851|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206849|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206850|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #7 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 206905 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206905&action=edit Bug 32459: Add ability to expire patrons when their category is changed A common use of update_patrons_category.pl is to move a child card to an adult account. When that happens some libraries need a new application form signed, because the patron is now responsible for the account themselves, so the card should stop working until they come in and sign it. Right now the cron only changes the category. There is no way to have it expire the accounts it touched, and expiring them afterwards by hand or with a report catches patrons the category change never touched. This patch adds an --expire switch. When it is passed, each updated patron gets an expiration date of yesterday, so they are expired as soon as their category changes. It can't be combined with --update-expiry, which sets the expiration date from the new category instead. 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 future 5) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --too_old --expire -v 6) Note the output says the expiration date will be set to yesterday, and that nothing was changed because this is test mode 7) Run the same command again, adding --confirm 8) Note the patron is now in ADULT and shows as expired! 9) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --update-expiry --expire --confirm 10) Note the script tells you the two switches can't be used together! Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #8 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 206906 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206906&action=edit Bug 32459: Add unit tests Test Plan: 1) Apply this patch 2) prove t/db_dependent/Patrons.t Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206905|0 |1 is obsolete| | Attachment #206906|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 207229 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207229&action=edit Bug 32459: Add ability to expire patrons when their category is changed A common use of update_patrons_category.pl is to move a child card to an adult account. When that happens some libraries need a new application form signed, because the patron is now responsible for the account themselves, so the card should stop working until they come in and sign it. Right now the cron only changes the category. There is no way to have it expire the accounts it touched, and expiring them afterwards by hand or with a report catches patrons the category change never touched. This patch adds an --expire switch. When it is passed, each updated patron gets an expiration date of yesterday, so they are expired as soon as their category changes. It can't be combined with --update-expiry, which sets the expiration date from the new category instead. 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 future 5) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --too_old --expire -v 6) Note the output says the expiration date will be set to yesterday, and that nothing was changed because this is test mode 7) Run the same command again, adding --confirm 8) Note the patron is now in ADULT and shows as expired! 9) Run misc/cronjobs/update_patrons_category.pl -f YOUTH -t ADULT --update-expiry --expire --confirm 10) Note the script tells you the two switches can't be used together! Sponsored-by: ByWater Solutions Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32459 --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 207230 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207230&action=edit Bug 32459: Add unit tests Test Plan: 1) Apply this patch 2) prove t/db_dependent/Patrons.t Sponsored-by: ByWater Solutions Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org