[Bug 28924] New: Allow NoIssuesCharge to be determined by patron category
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Bug ID: 28924 Summary: Allow NoIssuesCharge to be determined by patron category Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation 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 Currently, all patron categories have the NoIssuesCharge system preference amount applied uniformly. However there are situations where one patron category should have a higher (or lower) threshold, and it would be helpful to set this by patron category. For instance, for libraries that do ILL, items will frequently be marked as long overdue/lost due to the length of time they are checked out, and ILL account will be blocked from use. Being able to set specific patron categories to different NoIssuesCharge would resolve this. -- 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=28924 Kristi <kkrueger@cuyahogalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kkrueger@cuyahogalibrary.or | |g --- Comment #1 from Kristi <kkrueger@cuyahogalibrary.org> --- This would be particularly helpful for some of our unique patron categories. -- 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=28924 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Assignee|koha-bugs@lists.koha-commun |matt.blenkinsop@ptfs-europe |ity.org |.com -- 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=28924 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|matt.blenkinsop@ptfs-europe |jacob.omara@ptfs-europe.com |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jacob.omara@ptfs-europe.com |matt.blenkinsop@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff URL| |https://github.com/PTFS-Eur | |ope/koha/commits/bug_28924/ --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Branch available at https://github.com/PTFS-Europe/koha/commits/bug_28924/. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- We were wondering if there is a test plan for this one? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #4 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Test plan added to latest commit on the branch for future reference and also here for testing Patron category level noissuescharge Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees prove t/db_dependent/SIP/Transaction.t prove t/db_dependent/SIP/Patron.t prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t prove t/db_dependent/Koha/Patron.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #5 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165870 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165870&action=edit Bug 28924: Add 3 new columns to categories table This patch adds three new columns to the patron categories table: noissuescharge noissueschargegurantees noissueschargeguarantorswithguarantees These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #6 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165871 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165871&action=edit Bug 28924: Add DBIC file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #7 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165872 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165872&action=edit Bug 28924: Add new columns to UI and controller This patch adds the columns in the table and also updates the controller to allow these fields to be updated in the database from the UI form -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #8 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165873 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165873&action=edit Bug 28924: Add can_borrow and is_patron_inside_charge_limits methods This patch adds two new methods. can_borrow is a top-level method for determining whether a patron is able to borrow. Currently this logic is repeataed in multiple methods and shuld be more DRY. This bug is specific to patron charge limits so that is the focus but the method can be developed in follow-up bugs to cover all areas. The is_patron_inside_charge_limits method is now to be used where any of the three noissuescharge sysprefs are used. It will look at the patron category based on either a borrowernumber or patron object and return a hash detailing the charges, the charge limit and whether the patron is over the limit Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #9 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165874 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165874&action=edit Bug 28924: Update all usages of the current sysprefs This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #10 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165875 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165875&action=edit Bug 28924: Add a template method and update template usages This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #11 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165876 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165876&action=edit Bug 28924: Add unit tests for new methods and update existing tests This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Test plan: prove t/db_dependent/SIP/Transaction.t prove t/db_dependent/SIP/Patron.t prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t prove t/db_dependent/Koha/Patron.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #12 from Kristi <kkrueger@cuyahogalibrary.org> --- I am using a ByWater sandbox to go through the test plan, and at step 6, the No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees are not present when I edit a patron type. Would I need to have taken other steps than using one of these test sandboxes? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Kristi, from looking at the patches I think they should be there. Maybe the patches didn't apply cleanly. Maybe try again on another sandbox? @Matt: Please fix capitalization! No Issues Charge Guarantors With Guarantees: etc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165870|0 |1 is obsolete| | --- Comment #14 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 166042 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166042&action=edit Bug 28924: Add 3 new columns to categories table This patch adds three new columns to the patron categories table: noissuescharge noissueschargegurantees noissueschargeguarantorswithguarantees These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165871|0 |1 is obsolete| | --- Comment #15 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 166043 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166043&action=edit Bug 28924: Add DBIC file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165872|0 |1 is obsolete| | --- Comment #16 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 166044 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166044&action=edit Bug 28924: Add new columns to UI and controller This patch adds the columns in the table and also updates the controller to allow these fields to be updated in the database from the UI form -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165873|0 |1 is obsolete| | --- Comment #17 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 166045 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166045&action=edit Bug 28924: Add can_borrow and is_patron_inside_charge_limits methods This patch adds two new methods. can_borrow is a top-level method for determining whether a patron is able to borrow. Currently this logic is repeataed in multiple methods and shuld be more DRY. This bug is specific to patron charge limits so that is the focus but the method can be developed in follow-up bugs to cover all areas. The is_patron_inside_charge_limits method is now to be used where any of the three noissuescharge sysprefs are used. It will look at the patron category based on either a borrowernumber or patron object and return a hash detailing the charges, the charge limit and whether the patron is over the limit Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165874|0 |1 is obsolete| | --- Comment #18 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 166046 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166046&action=edit Bug 28924: Update all usages of the current sysprefs This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165875|0 |1 is obsolete| | --- Comment #19 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 166047 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166047&action=edit Bug 28924: Add a template method and update template usages This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165876|0 |1 is obsolete| | --- Comment #20 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 166048 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166048&action=edit Bug 28924: Add unit tests for new methods and update existing tests This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Test plan: prove t/db_dependent/SIP/Transaction.t prove t/db_dependent/SIP/Patron.t prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t prove t/db_dependent/Koha/Patron.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 David Nind <david@davidnind.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=28924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166042|0 |1 is obsolete| | --- Comment #21 from David Nind <david@davidnind.com> --- Created attachment 166171 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166171&action=edit Bug 28924: Add 3 new columns to categories table This patch adds three new columns to the patron categories table: noissuescharge noissueschargegurantees noissueschargeguarantorswithguarantees These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values 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=28924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166043|0 |1 is obsolete| | --- Comment #22 from David Nind <david@davidnind.com> --- Created attachment 166172 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166172&action=edit Bug 28924: Add DBIC file 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=28924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166044|0 |1 is obsolete| | --- Comment #23 from David Nind <david@davidnind.com> --- Created attachment 166173 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166173&action=edit Bug 28924: Add new columns to UI and controller This patch adds the columns in the table and also updates the controller to allow these fields to be updated in the database from the UI form 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=28924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166045|0 |1 is obsolete| | --- Comment #24 from David Nind <david@davidnind.com> --- Created attachment 166174 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166174&action=edit Bug 28924: Add can_borrow and is_patron_inside_charge_limits methods This patch adds two new methods. can_borrow is a top-level method for determining whether a patron is able to borrow. Currently this logic is repeataed in multiple methods and shuld be more DRY. This bug is specific to patron charge limits so that is the focus but the method can be developed in follow-up bugs to cover all areas. The is_patron_inside_charge_limits method is now to be used where any of the three noissuescharge sysprefs are used. It will look at the patron category based on either a borrowernumber or patron object and return a hash detailing the charges, the charge limit and whether the patron is over the limit Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees 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=28924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166046|0 |1 is obsolete| | --- Comment #25 from David Nind <david@davidnind.com> --- Created attachment 166175 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166175&action=edit Bug 28924: Update all usages of the current sysprefs This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits 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=28924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166047|0 |1 is obsolete| | --- Comment #26 from David Nind <david@davidnind.com> --- Created attachment 166176 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166176&action=edit Bug 28924: Add a template method and update template usages This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these. 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=28924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166048|0 |1 is obsolete| | --- Comment #27 from David Nind <david@davidnind.com> --- Created attachment 166177 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166177&action=edit Bug 28924: Add unit tests for new methods and update existing tests This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Test plan: prove t/db_dependent/SIP/Transaction.t prove t/db_dependent/SIP/Patron.t prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t prove t/db_dependent/Koha/Patron.t 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=28924 --- Comment #28 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I know I am late to this... but I've been thinking how "noissue" has never been a terribly good name. Wouldn't this be a chance to improve on it? Especially since "issue" is on the terminology list as no-use. But I see a point in consistency as the old prefs remain. (I hope I will survive this comment) -- You are receiving this mail because: You are watching all bug changes.
From reading the code: is_patron_inside_charge_limits checks for no issues charge limits like category/pref/defaults to 0
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply CC| |nick@bywatersolutions.com --- Comment #29 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Patch doesn't apply, please rebase then you test if the charges are defined - but they always will be, because default 0 CanBookBeIssued then also checks if they look like a number, and they always will because defaulted to 0 - before these patches leaving the pref blank means it isn't active (except noissuescharge) I will attach a test I think will fail after applying, check if I am right there. The two new routines in Patron.pm both take borrower arguments - is there a reason not to simply use 'self'? circ/circulation.pl line 590 You add 'noissues=>1' without checking the fines override pref - is this correct? The new GetPatronCharges routine in the Categories template plugin seems misplaced - I think we should be using your new routines directly from the patron object in the templates - it looks like there are other variables related to charges in the scripts - so we should try to avoid double work here and pass more info forward if we have already fetched it. I don't think the tests are covering all cases and should be expanded a bit. This is just a quick pass, so let me know if anything needs clarification -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166171|0 |1 is obsolete| | --- Comment #30 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167719 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167719&action=edit Bug 28924: Add 3 new columns to categories table This patch adds three new columns to the patron categories table: noissuescharge noissueschargegurantees noissueschargeguarantorswithguarantees These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166172|0 |1 is obsolete| | --- Comment #31 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167720 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167720&action=edit Bug 28924: Add DBIC file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166173|0 |1 is obsolete| | --- Comment #32 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167721 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167721&action=edit Bug 28924: Add new columns to UI and controller This patch adds the columns in the table and also updates the controller to allow these fields to be updated in the database from the UI form -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166174|0 |1 is obsolete| | --- Comment #33 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167722 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167722&action=edit Bug 28924: Add can_borrow and is_patron_inside_charge_limits methods This patch adds two new methods. can_borrow is a top-level method for determining whether a patron is able to borrow. Currently this logic is repeataed in multiple methods and shuld be more DRY. This bug is specific to patron charge limits so that is the focus but the method can be developed in follow-up bugs to cover all areas. The is_patron_inside_charge_limits method is now to be used where any of the three noissuescharge sysprefs are used. It will look at the patron category based on either a borrowernumber or patron object and return a hash detailing the charges, the charge limit and whether the patron is over the limit Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166175|0 |1 is obsolete| | --- Comment #34 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167723 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167723&action=edit Bug 28924: Update all usages of the current sysprefs This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166176|0 |1 is obsolete| | --- Comment #35 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167724 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167724&action=edit Bug 28924: Add a template method and update template usages This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166177|0 |1 is obsolete| | --- Comment #36 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167725 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167725&action=edit Bug 28924: Add unit tests for new methods and update existing tests This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Test plan: prove t/db_dependent/SIP/Transaction.t prove t/db_dependent/SIP/Patron.t prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t prove t/db_dependent/Koha/Patron.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #37 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167726 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167726&action=edit Bug 28924: (QA follow-up) Use $self instead of $patron -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #38 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167727 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167727&action=edit Bug 28924: (QA follow-up): Don't define charge values as 0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #39 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167728 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167728&action=edit Bug 28924: (QA follow-up): Remove unnecessary template method -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #40 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167729 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167729&action=edit Bug 28924: (QA follow-up): Fix unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167719|0 |1 is obsolete| | --- Comment #41 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167730 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167730&action=edit Bug 28924: Add 3 new columns to categories table This patch adds three new columns to the patron categories table: noissuescharge noissueschargegurantees noissueschargeguarantorswithguarantees These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values 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=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167720|0 |1 is obsolete| | --- Comment #42 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167731 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167731&action=edit Bug 28924: Add DBIC file 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=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167721|0 |1 is obsolete| | --- Comment #43 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167732 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167732&action=edit Bug 28924: Add new columns to UI and controller This patch adds the columns in the table and also updates the controller to allow these fields to be updated in the database from the UI form 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=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167722|0 |1 is obsolete| | --- Comment #44 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167733 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167733&action=edit Bug 28924: Add can_borrow and is_patron_inside_charge_limits methods This patch adds two new methods. can_borrow is a top-level method for determining whether a patron is able to borrow. Currently this logic is repeataed in multiple methods and shuld be more DRY. This bug is specific to patron charge limits so that is the focus but the method can be developed in follow-up bugs to cover all areas. The is_patron_inside_charge_limits method is now to be used where any of the three noissuescharge sysprefs are used. It will look at the patron category based on either a borrowernumber or patron object and return a hash detailing the charges, the charge limit and whether the patron is over the limit Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees 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=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167723|0 |1 is obsolete| | --- Comment #45 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167734 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167734&action=edit Bug 28924: Update all usages of the current sysprefs This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits 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=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167724|0 |1 is obsolete| | --- Comment #46 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167735 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167735&action=edit Bug 28924: Add a template method and update template usages This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these. 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=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167725|0 |1 is obsolete| | --- Comment #47 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167736 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167736&action=edit Bug 28924: Add unit tests for new methods and update existing tests This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Test plan: prove t/db_dependent/SIP/Transaction.t prove t/db_dependent/SIP/Patron.t prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t prove t/db_dependent/Koha/Patron.t 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=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167726|0 |1 is obsolete| | --- Comment #48 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167737 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167737&action=edit Bug 28924: (QA follow-up) Use $self instead of $patron -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167727|0 |1 is obsolete| | --- Comment #49 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167738 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167738&action=edit Bug 28924: (QA follow-up): Don't define charge values as 0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167728|0 |1 is obsolete| | --- Comment #50 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167739 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167739&action=edit Bug 28924: (QA follow-up): Remove unnecessary template method -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167729|0 |1 is obsolete| | --- Comment #51 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 167740 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167740&action=edit Bug 28924: (QA follow-up): Fix unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #52 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Forgot David's sign off lines first time round (In reply to Nick Clemens (kidclamp) from comment #29)
Patch doesn't apply, please rebase
Rebased
From reading the code: is_patron_inside_charge_limits checks for no issues charge limits like category/pref/defaults to 0 then you test if the charges are defined - but they always will be, because default 0
Looks like I was confusing a falsy value with an undefined value - good spot. I've amended this now to not set the default
CanBookBeIssued then also checks if they look like a number, and they always will because defaulted to 0 - before these patches leaving the pref blank means it isn't active (except noissuescharge) I will attach a test I think will fail after applying, check if I am right there.
As above
The two new routines in Patron.pm both take borrower arguments - is there a reason not to simply use 'self'?
They should definitely be using $self, not sure what I was doing there
circ/circulation.pl line 590 You add 'noissues=>1' without checking the fines override pref - is this correct?
Don't think that should be there, have removed it
The new GetPatronCharges routine in the Categories template plugin seems misplaced - I think we should be using your new routines directly from the patron object in the templates - it looks like there are other variables related to charges in the scripts - so we should try to avoid double work here and pass more info forward if we have already fetched it.
I've removed the method and passed the data through. The values already existed in the template so just needed adding into the inc files
I don't think the tests are covering all cases and should be expanded a bit.
Can you give an example of a case you think is missing?
This is just a quick pass, so let me know if anything needs clarification
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #53 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Need to add the 'Sponsored-by: Cuyahoga' here Matt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167730|0 |1 is obsolete| | Attachment #167731|0 |1 is obsolete| | Attachment #167732|0 |1 is obsolete| | Attachment #167733|0 |1 is obsolete| | Attachment #167734|0 |1 is obsolete| | Attachment #167735|0 |1 is obsolete| | Attachment #167736|0 |1 is obsolete| | Attachment #167737|0 |1 is obsolete| | Attachment #167738|0 |1 is obsolete| | Attachment #167739|0 |1 is obsolete| | Attachment #167740|0 |1 is obsolete| | --- Comment #54 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168728 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168728&action=edit Bug 28924: Add 3 new columns to categories table This patch adds three new columns to the patron categories table: noissuescharge noissueschargegurantees noissueschargeguarantorswithguarantees These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #55 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168729 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168729&action=edit Bug 28924: Add DBIC file Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #56 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168730 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168730&action=edit Bug 28924: Add new columns to UI and controller This patch adds the columns in the table and also updates the controller to allow these fields to be updated in the database from the UI form Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #57 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168731 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168731&action=edit Bug 28924: Add can_borrow and is_patron_inside_charge_limits methods This patch adds two new methods. can_borrow is a top-level method for determining whether a patron is able to borrow. Currently this logic is repeataed in multiple methods and shuld be more DRY. This bug is specific to patron charge limits so that is the focus but the method can be developed in follow-up bugs to cover all areas. The is_patron_inside_charge_limits method is now to be used where any of the three noissuescharge sysprefs are used. It will look at the patron category based on either a borrowernumber or patron object and return a hash detailing the charges, the charge limit and whether the patron is over the limit Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #58 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168732 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168732&action=edit Bug 28924: Update all usages of the current sysprefs This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #59 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168733 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168733&action=edit Bug 28924: Add a template method and update template usages This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these. Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #60 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168734 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168734&action=edit Bug 28924: Add unit tests for new methods and update existing tests This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Test plan: prove t/db_dependent/SIP/Transaction.t prove t/db_dependent/SIP/Patron.t prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t prove t/db_dependent/Koha/Patron.t Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #61 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168735 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168735&action=edit Bug 28924: (QA follow-up) Use $self instead of $patron Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #62 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168736 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168736&action=edit Bug 28924: (QA follow-up): Don't define charge values as 0 Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #63 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168737 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168737&action=edit Bug 28924: (QA follow-up): Remove unnecessary template method Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #64 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168738 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168738&action=edit Bug 28924: (QA follow-up): Fix unit tests Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #65 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- (In reply to Matt Blenkinsop from comment #52)
Can you give an example of a case you think is missing?
On second pass these looked sufficient :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Allow NoIssuesCharge to be |Allow checkout fine limit |determined by patron |to be determined by patron |category |category Status|Passed QA |Failed QA --- Comment #66 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 1) Is this correct? [% IF ( charges ) %] - [% INCLUDE 'blocked-fines.inc' borrowernumber = patron.borrowernumber %] + [% INCLUDE 'blocked-fines.inc' NoIssuesCharge = chargesamount %] [% END %] It looks like we are losing the borrowernumber? 2) Terminology https://wiki.koha-community.org/wiki/Terminology a) +=head3 can_borrow ... +This method determines whether a borrower is able to borrow based on various parameters. +- Debarrments I feel like this should be "can_checkout" to follow our terminology guide and because borrow/lend is a common one to get confused by non-native speakers. Also some small stuff borrower = patron etc. b) noissuecharge The noissuecharge parameter is badly named and has always been. I feel like we will never will fully recover from it as it has spread to other system preferences by now, but I wonder if we could at least start to move into a better direction with the new database table columns: noissuescharge noissueschargeguarantees noissueschargeguarantorswithguarantees I can see the consistency here, so this is more a question than a blocker. I was thinking along the lines of checkout_charge_limit or so. c) Templates So this is a blocker for me, because I can see the consistency with the codes/prefs, but I think we can do better in the templates and stick to the agreed on terms: + <th scope="col">No issues charge</th> + <th scope="col">No issues charge guarantees</th> + <th scope="col">No issues charge guarantors with guarantees</th> Also in the input form. What about: Checkout charge limit... ? And maybe a good hint for the input form with reference and link to noissuescharge and the other preferences if we want to make that connection visible. 3) Don't include api/v1/swagger/swagger_bundle.json It's in this patch: Subject: [PATCH] Bug 28924: Add new columns to UI and controller It will be automatically generated. 4) Translatability This smells untranslatable: - my $noissuescharge = C4::Context->preference("noissuescharge") || 5; - $flaginfo{'message'} = sprintf 'Patron owes %.02f', $owing; - $flaginfo{'amount'} = sprintf "%.02f", $owing; - if ( $owing > $noissuescharge && !C4::Context->preference("AllowFineOverride") ) { + my $noissuescharge = $patron_charge_limits->{noissuescharge}->{limit} || 5; + $flaginfo{'message'} = sprintf 'Patron owes %.02f', $patron_charge_limits->{noissuescharge}->{charge}; + $flaginfo{'amount'} = sprintf "%.02f", $patron_charge_limits->{noissuescharge}->{charge}; - $flaginfo{'message'} = sprintf 'patron guarantees owe %.02f', $guarantees_non_issues_charges; - $flaginfo{'amount'} = $guarantees_non_issues_charges; + $flaginfo{'message'} = sprintf 'patron guarantees owe %.02f', $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge}; + $flaginfo{'amount'} = $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge}; Also the Price formatting will be wrong (CurrentyFormat). I am not sure where this is used? 5) Documentation + `noissuescharge` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked', + `noissueschargeguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked', + `noissueschargeguarantorswithguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked', These all have the same description - what is the difference? 6) Formatting Please use the $Price TT filter for proper formatting of the prices on display, including the 0.00 default: + [% IF (category.noissuescharge) %] + <td>[% category.noissuescharge | html %]</td> + [% ELSE %] + <td>0.00</td> + [% END %] + [% IF (category.noissueschargeguarantees) %] + <td>[% category.noissueschargeguarantees | html %]</td> + [% ELSE %] + <td>0.00</td> + [% END %] + [% IF (category.noissueschargeguarantorswithguarantees) %] + <td>[% category.noissueschargeguarantorswithguarantees | html %]</td> + [% ELSE %] + <td>0.00</td> + [% END %] 7) Price handling on input fields You need to use $Price on_editing on the input fields, I believe: Example: <input class="decimal" type="text" size="20" name="rrp" id="rrp" value="[% rrp | $Price on_editing => 1 %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168728|0 |1 is obsolete| | --- Comment #67 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168984 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168984&action=edit Bug 28924: Add 3 new columns to categories table This patch adds three new columns to the patron categories table: noissuescharge noissueschargegurantees noissueschargeguarantorswithguarantees These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168729|0 |1 is obsolete| | --- Comment #68 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168985&action=edit Bug 28924: Add DBIC file Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168730|0 |1 is obsolete| | --- Comment #69 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168986 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168986&action=edit Bug 28924: Add new columns to UI and controller This patch adds the columns in the table and also updates the controller to allow these fields to be updated in the database from the UI form Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168731|0 |1 is obsolete| | --- Comment #70 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168987 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168987&action=edit Bug 28924: Add can_borrow and is_patron_inside_charge_limits methods This patch adds two new methods. can_borrow is a top-level method for determining whether a patron is able to borrow. Currently this logic is repeataed in multiple methods and shuld be more DRY. This bug is specific to patron charge limits so that is the focus but the method can be developed in follow-up bugs to cover all areas. The is_patron_inside_charge_limits method is now to be used where any of the three noissuescharge sysprefs are used. It will look at the patron category based on either a borrowernumber or patron object and return a hash detailing the charges, the charge limit and whether the patron is over the limit Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168732|0 |1 is obsolete| | --- Comment #71 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168988 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168988&action=edit Bug 28924: Update all usages of the current sysprefs This patch updates all instances where the current noissuescharge sysprefs are used. They will now use the is_patron_inside_charge_limits method to handle the patron category level limits Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168733|0 |1 is obsolete| | --- Comment #72 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168989 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168989&action=edit Bug 28924: Add a template method and update template usages This patch adds a method to be used in the template where currently the Koha.Preference('noissuescharge') method is used. This currently does not take into account the new patron category level limits and so needs to be updated to its own method to handle these. Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168734|0 |1 is obsolete| | --- Comment #73 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168990 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168990&action=edit Bug 28924: Add unit tests for new methods and update existing tests This commit adds unit tests for the two new methods introduced and also updates all unit tests that use the noissuecharge sysprefs Test plan: 1. Choose a patron and note their patron category 2. Create a manual invoice on that patron for 6.00 3. Try to check an item out to the patron and it will show a message saying that checkout is blocked because the fine balance is over the limit. 4. This is because the default global value for the ‘noissuescharge’ is 5.00 and we are now over that limit 5. Navigate to Administration > Patron categories and click to edit the category relevant to your patron 6. At the bottom of the form will be fields called No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees. Set those fields to 7 7. Now try and checkout again - this time you will be allowed to checkout as the category level limit is higher than the fine we set. 8. Choose a different patron (patron 2) with a category that is different to the first patron (patron 1). 9. Repeat steps 2 and 3. This time checkout will be blocked again because the limit for this patron category is still the global value of 5.00 10. Choose a third patron with a category of child or similar (patron 3) 11. Make patron 1 a guarantor for patron 3 12. Edit patron 3’s patron category and set the limit for No Issues Charge, No Issues Charge Guarantees and No Issues Charge Guarantors With Guarantees to 5. 13. Try to check out to patron 3 and it will be blocked due to the fines on patron 1’s account 14. Try to checkout to patron 1 - it should still be possible 15. Add a fine to patron 3’s account for 2.00 16. Try to check out to patron 1 - the checkout will be blocked due to the total of 8 now owed by the patron and its guarantees Test plan: prove t/db_dependent/SIP/Transaction.t prove t/db_dependent/SIP/Patron.t prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t prove t/db_dependent/Koha/Patron.t Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168735|0 |1 is obsolete| | --- Comment #74 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168991 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168991&action=edit Bug 28924: (QA follow-up) Use $self instead of $patron Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168736|0 |1 is obsolete| | --- Comment #75 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168992 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168992&action=edit Bug 28924: (QA follow-up): Don't define charge values as 0 Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168737|0 |1 is obsolete| | --- Comment #76 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168993 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168993&action=edit Bug 28924: (QA follow-up): Remove unnecessary template method Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168738|0 |1 is obsolete| | --- Comment #77 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168994 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168994&action=edit Bug 28924: (QA follow-up): Fix unit tests Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #78 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 168995 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168995&action=edit Bug 28924: (QA follow-up) Terminology fixes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #79 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- (In reply to Katrin Fischer from comment #66)
1) Is this correct?
[% IF ( charges ) %] - [% INCLUDE 'blocked-fines.inc' borrowernumber = patron.borrowernumber %] + [% INCLUDE 'blocked-fines.inc' NoIssuesCharge = chargesamount %] [% END %]
It looks like we are losing the borrowernumber?
The patron is still picked up by the template and populates the links correctly
2) Terminology
https://wiki.koha-community.org/wiki/Terminology
a) +=head3 can_borrow ... +This method determines whether a borrower is able to borrow based on various parameters. +- Debarrments
I feel like this should be "can_checkout" to follow our terminology guide and because borrow/lend is a common one to get confused by non-native speakers.
Also some small stuff borrower = patron etc.
Fixed :)
b) noissuecharge
The noissuecharge parameter is badly named and has always been. I feel like we will never will fully recover from it as it has spread to other system preferences by now, but I wonder if we could at least start to move into a better direction with the new database table columns:
noissuescharge noissueschargeguarantees noissueschargeguarantorswithguarantees
I can see the consistency here, so this is more a question than a blocker. I was thinking along the lines of checkout_charge_limit or so.
I think this probably needs breaking out into a separate bug with some discussion about how to change the terminology and agreement on the wording to use. Then this probably needs to be implemented across Koha more widely including the original sysprefs rather than doing it in just one place otherwise we risk introducing even more inconsistency in these patches
c) Templates
So this is a blocker for me, because I can see the consistency with the codes/prefs, but I think we can do better in the templates and stick to the agreed on terms:
+ <th scope="col">No issues charge</th> + <th scope="col">No issues charge guarantees</th> + <th scope="col">No issues charge guarantors with guarantees</th>
Also in the input form.
What about: Checkout charge limit... ? And maybe a good hint for the input form with reference and link to noissuescharge and the other preferences if we want to make that connection visible.
I've updated these as suggested and added a hint
3) Don't include api/v1/swagger/swagger_bundle.json
It's in this patch: Subject: [PATCH] Bug 28924: Add new columns to UI and controller
It will be automatically generated.
Done, its in gitignore so not sure how it made it into the patch
4) Translatability
This smells untranslatable:
- my $noissuescharge = C4::Context->preference("noissuescharge") || 5; - $flaginfo{'message'} = sprintf 'Patron owes %.02f', $owing; - $flaginfo{'amount'} = sprintf "%.02f", $owing; - if ( $owing > $noissuescharge && !C4::Context->preference("AllowFineOverride") ) { + my $noissuescharge = $patron_charge_limits->{noissuescharge}->{limit} || 5; + $flaginfo{'message'} = sprintf 'Patron owes %.02f', $patron_charge_limits->{noissuescharge}->{charge}; + $flaginfo{'amount'} = sprintf "%.02f", $patron_charge_limits->{noissuescharge}->{charge};
- $flaginfo{'message'} = sprintf 'patron guarantees owe %.02f', $guarantees_non_issues_charges; - $flaginfo{'amount'} = $guarantees_non_issues_charges; + $flaginfo{'message'} = sprintf 'patron guarantees owe %.02f', $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge}; + $flaginfo{'amount'} = $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge};
Also the Price formatting will be wrong (CurrentyFormat). I am not sure where this is used?
This is only used in the SIP module when creating the patron object. There isn't any template that I can see that this gets rendered into as I assume this is handled by the hardware supplier that SIP is connecting to
5) Documentation
+ `noissuescharge` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked', + `noissueschargeguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked', + `noissueschargeguarantorswithguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked',
These all have the same description - what is the difference?
Fixed the descriptions, clearly didn't change them after a copy and paste job!
6) Formatting
Please use the $Price TT filter for proper formatting of the prices on display, including the 0.00 default:
+ [% IF (category.noissuescharge) %] + <td>[% category.noissuescharge | html %]</td> + [% ELSE %] + <td>0.00</td> + [% END %] + [% IF (category.noissueschargeguarantees) %] + <td>[% category.noissueschargeguarantees | html %]</td> + [% ELSE %] + <td>0.00</td> + [% END %] + [% IF (category.noissueschargeguarantorswithguarantees) %] + <td>[% category.noissueschargeguarantorswithguarantees | html %]</td> + [% ELSE %] + <td>0.00</td> + [% END %]
Done
7) Price handling on input fields
You need to use $Price on_editing on the input fields, I believe:
Example: <input class="decimal" type="text" size="20" name="rrp" id="rrp" value="[% rrp | $Price on_editing => 1 %]
Done -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #80 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thanks for the follow-up! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #81 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #82 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I believe this might have broken the tests: t_db_dependent_api_v1_patron_categories_t Build #636 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #83 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 169177 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169177&action=edit Bug 28924: (follow-up): Fix API spec This patch fixes the API definition for a patron category, as highlighted by the failing tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37426 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37426 [Bug 37426] DBIC schema file Category.pm manually modified causes checksum mismatch and blocking refresh of that file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #84 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Here, something unintended made a DBIC schema file inconsistent and it blocks it's autogeneration, see Bug 37426 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #85 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 169428 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169428&action=edit Bug 28924: (follow-up) Decimal points count as characters The restriction to 3 characters in the new patron category fields was too strict.. the default for $Price on_editing is 0.00 (makes sense right).. and that's 4 Characters so we were failing validation. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 --- Comment #86 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- More failing tests so I've pushed the follow-up above to make those happy.. A '.' counts as a character.. who would think ;P -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This allows to set charge release notes| |limits for checkouts by | |patron category. If the | |patron category level | |option is not used, the | |global system preferences | |will be used instead. | | | |The | |new options available are: | | | |- Checkout charge limit | |(`noissuescharge`) | |- | |Guarantee checkout charge | |limit | |(`NoIssuesChargeGuarantees | |preference`) | |- Guarantors | |with guarantees checkout | |charge limit | |(`NoIssuesChargeGuarantorsW | |ithGuarantees`) Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38727 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38727 [Bug 38727] Improve translatability in categories.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Documentation| |Caroline Cyr La Rose contact| | Resolution|--- |FIXED Documentation| |https://gitlab.com/koha-com submission| |munity/koha-manual/-/merge_ | |requests/1006 Status|Needs documenting |RESOLVED CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39261 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39261 [Bug 39261] Category charge limits are integers in db but decimals in form -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40701 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40701 [Bug 40701] Message "Checkouts are BLOCKED because fine balance is OVER THE LIMIT." doesn't display anymore -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org