[Bug 44030] New: FineNoRenewalsBlockAutoRenew set to "allow" no longer allows automatic renewals
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44030 Bug ID: 44030 Summary: FineNoRenewalsBlockAutoRenew set to "allow" no longer allows automatic renewals Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- FineNoRenewalsBlockAutoRenew reads "If a patron owes more than the value of FineNoRenewals, [block / allow] their auto-renewals." Set to "allow", automatic renewals of a patron who owes more than FineNoRenewals are still refused. Since bug 23415, CanBookBeRenewed checks FineNoRenewals for every renewal and returns too_much_owing. _CanBookBeAutoRenewed only returns auto_too_much_owing when the preference is "block"; when it is "allow" the automatic renewal goes on to the general check and is refused there anyway. Bug 23415 added an override for self checkout (FineNoRenewalsBlockSelfCheckRenew in sco-main.pl) but not for automatic renewals, so this preference now only changes the error code, never the outcome. To reproduce: 1. FineNoRenewals = 10, FineNoRenewalsBlockAutoRenew = allow. 2. Check out an item as an automatic renewal to a patron with automatic renewals enabled, and make it due for renewal. 3. Give the patron a 15.00 charge. 4. Run misc/cronjobs/automatic_renewals.pl -c: the checkout is not renewed, auto_renew_error = too_much_owing. Reproduced on Koha 26.05.02; the same code is on main. -- 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=44030 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 210879 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210879&action=edit Bug 44030: Let FineNoRenewalsBlockAutoRenew allow automatic renewals again Bug 44030: Let FineNoRenewalsBlockAutoRenew allow automatic renewals again Since bug 23415 CanBookBeRenewed refuses any renewal when the patron owes more than FineNoRenewals (too_much_owing). For automatic renewals the choice belongs to FineNoRenewalsBlockAutoRenew: _CanBookBeAutoRenewed already returns auto_too_much_owing when it is set to block. When it is set to allow, the cron reached the general check and was refused anyway, so "allow" did nothing. The general fine check now leaves a cron renewal of an auto-renewing checkout to that preference. Renewals by staff, the OPAC or self checkout are checked exactly as before. Test plan: 1. FineNoRenewals = 10, FineNoRenewalsBlockAutoRenew = allow. 2. Check out an item with "Automatic renewal" to a patron whose autorenew_checkouts is on, and set the circulation rule "No automatic renewal before" so that it is due for renewal. 3. Add a 15.00 manual invoice to the patron. 4. perl misc/cronjobs/automatic_renewals.pl -c -v: not renewed (too_much_owing). 5. Apply the patch, repeat 4: the checkout is renewed. 6. Set FineNoRenewalsBlockAutoRenew = block, repeat 4 with another such checkout: not renewed (auto_too_much_owing). 7. Renewing the item from the staff interface is still refused for the fine. 8. prove t/db_dependent/Circulation.t Sponsored-by: Koha Solutions -- 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=44030 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.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=44030 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #2 from David Nind <david@davidnind.com> --- It is not clear to me how to do step 2 of the test plan, as I'm not familiar with this area. Some specific step-by-step instructions and settings for step 2 would help. Testing notes (using KTD): 1. Step 1: System preferences: - FineNoRenewals: change the default (100) to 10 - FineNoRenewalsBlockAutoRenew: default is already "Allow" 2. Step 2: - For a patron, edit their account > Library management > Allow auto-renewal of items: set to "Yes" (default in KTD I think, set to yes for Mary Burton) - Circulation rule "No automatic renewal before": . Edit the All All rule (Administration > Patrons and circulation > Circulation and fine rules) . Set "No automatic renewal before" to X (set to 5, the same as the default loan period?) - Check out Programming Perl (39999000011418) to Mary Burton -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44030 --- Comment #3 from babar junaid <babarjunaid1122@gmail.com> --- Thanks for testing, David. Detailed steps for KTD (checked on 26.05 with the KTD sample data): 1. System preferences: FineNoRenewals = 10, FineNoRenewalsBlockAutoRenew = Allow (the default). 2. Administration > Circulation and fine rules, edit the "All / All" rule: - Loan period: 5 (days) - Renewals allowed (count): 5 (anything above 0) - Automatic renewal: Yes - No automatic renewal before: 10 Because 10 is more than the loan period, a new checkout is already inside the automatic renewal window, so the cron tries to renew it straight away. No date changes are needed. 3. Mary Burton > Edit > Library management > "Allow auto-renewal of items": Yes (already Yes in KTD). 4. Check out Programming Perl (39999000011418) to Mary Burton. It becomes an automatic renewal from the rule. The "Automatic renewal" box under Checkout settings shows ticked but greyed out; that's expected. 5. Mary > Accounting > Create manual invoice > Amount 15.00 > Save. 6. In a KTD shell: perl misc/cronjobs/automatic_renewals.pl -v -c Without the patch: "Issue id: … for borrower: … will not be renewed. (too_much_owing)", and the due date does not change. 7. Apply the patch and repeat step 6: the checkout is renewed, and its due date moves on. (Without -c the script only reports "would be renewed" / "would not be renewed", without renewing.) 8. Set FineNoRenewalsBlockAutoRenew = Block. Check the item in, check it out to Mary again, and repeat step 6: "will not be renewed. (auto_too_much_owing)". 9. With the patch applied, renew the item from Mary's checkouts in the staff interface: it is still refused because of the fine. 10. prove t/db_dependent/Circulation.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44030 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Comma delimited| |Koha Solutions list of Sponsors| | Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44030 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210879|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=44030 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 211166 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211166&action=edit Bug 44030: Let FineNoRenewalsBlockAutoRenew allow automatic renewals again Since bug 23415 CanBookBeRenewed refuses any renewal when the patron owes more than FineNoRenewals (too_much_owing). For automatic renewals the choice belongs to FineNoRenewalsBlockAutoRenew: _CanBookBeAutoRenewed already returns auto_too_much_owing when it is set to block. When it is set to allow, the cron reached the general check and was refused anyway, so "allow" did nothing. The general fine check now leaves a cron renewal of an auto-renewing checkout to that preference. Renewals by staff, the OPAC or self checkout are checked exactly as before. Test plan: 1. FineNoRenewals = 10, FineNoRenewalsBlockAutoRenew = allow. 2. Check out an item with "Automatic renewal" to a patron whose autorenew_checkouts is on, and set the circulation rule "No automatic renewal before" so that it is due for renewal. 3. Add a 15.00 manual invoice to the patron. 4. perl misc/cronjobs/automatic_renewals.pl -c -v: not renewed (too_much_owing). 5. Apply the patch, repeat 4: the checkout is renewed. 6. Set FineNoRenewalsBlockAutoRenew = block, repeat 4 with another such checkout: not renewed (auto_too_much_owing). 7. Renewing the item from the staff interface is still refused for the fine. 8. prove t/db_dependent/Circulation.t Sponsored-by: Koha Solutions Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44030 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed --- Comment #5 from David Nind <david@davidnind.com> --- Thanks for the detailed steps, much appreciated! Now signed off! Additional testing notes ======================== Before the patch ---------------- perl misc/cronjobs/automatic_renewals.pl -v -c getting auto renewals found 1 auto renewals examining item '578' to auto renew For the item checked out under Details (Or Check out), for the "Renew" column: 0 Cannot renew - patron has debts blocking renewal (5 of 5 renewals remaining) (Scheduled for automatic renewal) Note: The due date is not changed After the patch --------------- perl misc/cronjobs/automatic_renewals.pl -v -c getting auto renewals found 1 auto renewals examining item '578' to auto renew Issue id: 1 for borrower: 49 and item: 578 will be renewed. For the item checked out under Details (Or Check out), for the "Renew" column: 1 Cannot renew - patron has debts blocking renewal (4 of 5 renewals remaining) (Scheduled for automatic renewal) Note: The due date is changed (+5 days) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org