[Bug 19382] New: Add ability to block guarantees based on fees owed by guarantor and other guarantees
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Bug ID: 19382 Summary: Add ability to block guarantees based on fees owed by guarantor and other guarantees Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Depends on: 14570, 14577 Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14570 [Bug 14570] Make it possible to add multiple guarantors to a record https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14577 [Bug 14577] Allow restriction of checkouts based on fines of guarantor/guarantee -- 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=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Bug 19382 depends on bug 14570, which changed state. Bug 14570 Summary: Make it possible to add multiple guarantors to a record https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14570 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 97234 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97234&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97234|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 97235 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97235&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Should this be NSO? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97235|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 97303 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97303&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Donna <bwsdonna@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bwsdonna@gmail.com --- Comment #5 from Donna <bwsdonna@gmail.com> --- Updated testing plan: Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3. Set NoIssuesChargeGuarantees to $14 4) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 5) Give 3 of the 4 a $5 fine 6) None of them should be able to check out items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #6 from Donna <bwsdonna@gmail.com> --- When checking out to parent, the total that shows is the total fine amount for the guarantees, does not include the other guarantor dollar amount. For example, Child 1 owes $5, Child 2 owes $5, Parent 1 owes $5. When parent 2 checks out, message states $10 owed by guarantees. When Child 3 (no fines) checks out, message states: The patron's guarantors and their other guarantees collectively have a debt of 15.00. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Donna <bwsdonna@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97303|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 99196 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99196&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Barbara Johnson <barbara.johnson@bedfordtx.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |barbara.johnson@bedfordtx.g | |ov Status|Needs Signoff |Signed Off --- Comment #8 from Barbara Johnson <barbara.johnson@bedfordtx.gov> --- The test plan worked exactly as stated so I will sign off on it. I have some additional observations. The blocking message during checkout showing the total amount owed by the family of four is great. However, it seems like it will take some time to locate who has the fines in order to make payments and get the family below the threshold amount for blocking. It would be helpful if the blocking message on circulation.pl could include a summary on the screen that listed each family member with their associated fines along with clickable links to make immediate payments. I can open a new buf that addresses this extra functionality. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99196|0 |1 is obsolete| | --- Comment #9 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 102090 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102090&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102090|0 |1 is obsolete| | --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 106534 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106534&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- What I've done on a fresh database: - Apply patch - Run updatedatabase - restart_all - NoIssuesChargeGuarantorsWithGuarantees to 1 - Added a daughter to one of the existing patrons - Added a 2$ manual invoice to both - Both can still check out and no warning is shown. Can you check please? I have uploaded the patches as I did a minor rebase (sysprefs.sql) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #11)
What I've done on a fresh database:
- Apply patch - Run updatedatabase - restart_all - NoIssuesChargeGuarantorsWithGuarantees to 1 - Added a daughter to one of the existing patrons - Added a 2$ manual invoice to both - Both can still check out and no warning is shown.
Can you check please?
I have uploaded the patches as I did a minor rebase (sysprefs.sql)
Also tried adding a second daughter - not blocked either :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 107344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107344&action=edit Bug 19382: Add blocking of ability to checkout on circulation.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas.jonsson@kreablo.se -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Kyle, I spotted an unresolved TODO: + my $guarantees_fines_amount = $flags->{CHARGES_GUARANTEES} ? $flags->{CHARGES_GUARANTEES}->{amount} : 0; #TODO: Replace with $patron->relationships_debt Do you want to fix this? The "blocking" worked this time for me. :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #14)
Hi Kyle,
I spotted an unresolved TODO:
+ my $guarantees_fines_amount = $flags->{CHARGES_GUARANTEES} ? $flags->{CHARGES_GUARANTEES}->{amount} : 0; #TODO: Replace with $patron->relationships_debt
Do you want to fix this?
Those are really just ideas for future backend enhancements. I'd be happy to file them!
The "blocking" worked this time for me. :)
Excellent! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #106534|0 |1 is obsolete| | --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 109210 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109210&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #107344|0 |1 is obsolete| | --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 109211 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109211&action=edit Bug 19382: Add blocking of ability to checkout on circulation.pl Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 109210 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109210 Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Review of attachment 109210: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=19382&attachment=109210) ----------------------------------------------------------------- ::: t/db_dependent/Koha/Patron.t @@ +153,5 @@
+ is( $child_1->relationships_debt({ only_this_guarantor => 0, include_guarantors => 0, include_this_patron => 0 }), 10, 'Family debt is correct' ); + is( $child_1->relationships_debt({ only_this_guarantor => 0, include_guarantors => 0, include_this_patron => 1 }), 10, 'Family debt is correct' ); + is( $child_1->relationships_debt({ only_this_guarantor => 0, include_guarantors => 1, include_this_patron => 0 }), 10, 'Family debt is correct' ); + is( $child_1->relationships_debt({ only_this_guarantor => 0, include_guarantors => 1, include_this_patron => 1 }), 10, 'Family debt is correct' ); + is( $child_1->relationships_debt({ only_this_guarantor => 1, include_guarantors => 0, include_this_patron => 0 }), 0, 'Family debt is correct' );
Is this correct? $child_1 is not a guarantor so I don't think it should follow "only_this_guarantor". I would have expected 10 here, can you confirm? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 109349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109349&action=edit Bug 19382: Tests refactoring -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Asking because I was trying to make the tests more readable, see the last patch, some testes are failing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #21 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 109357 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109357&action=edit Bug 19382: Tests refactoring [alternate] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #22 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #20)
Asking because I was trying to make the tests more readable, see the last patch, some testes are failing.
I think putting the tests in a loop here just adds obfuscation, especially my attempt ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Yes indeed. My idea was to make the tests more readable, and this: + $amount = 0 if ( $patron->id == $child_2->id && ( $i == 0 || $i == 2 || $i == 4 || $i == 5 || $i == 6 ) ); is something I'd like to avoid :) What about the previous question? (In reply to Jonathan Druart from comment #18)
+ is( $child_1->relationships_debt({ only_this_guarantor => 1, include_guarantors => 0, include_this_patron => 0 }), 0, 'Family debt is correct' );
Is this correct? $child_1 is not a guarantor so I don't think it should follow "only_this_guarantor". I would have expected 10 here, can you confirm?
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #24 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #23)
Yes indeed. My idea was to make the tests more readable, and this:
+ $amount = 0 if ( $patron->id == $child_2->id && ( $i == 0 || $i == 2 || $i == 4 || $i == 5 || $i == 6 ) );
is something I'd like to avoid :)
Yes, I agree what I wrote there is just awful ;)
What about the previous question? (In reply to Jonathan Druart from comment #18)
+ is( $child_1->relationships_debt({ only_this_guarantor => 1, include_guarantors => 0, include_this_patron => 0 }), 0, 'Family debt is correct' );
Is this correct? $child_1 is not a guarantor so I don't think it should follow "only_this_guarantor". I would have expected 10 here, can you confirm?
In this case, since the patron is not a guarantor, we have no guarantors to get debt from, we are also saying don't include this patron. Basically with this combination for a guarantee, the result will always 0. I think this makes more sense than simply ignoring only_this_guarantor if the patron is not a guarantor. As it is written it follows a consistent internal logic. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Take a look at this: child 1 debt is correct (only_this_guarantor => 1, include_guarantors => 0, include_this_patron => 0) => 0 child 1 debt is correct (only_this_guarantor => 0, include_guarantors => 0, include_this_patron => 0) => 10 That does not make a lot of sense IMO, both returns should be the same. Don't you think? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #26 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #25)
Take a look at this:
child 1 debt is correct (only_this_guarantor => 1, include_guarantors => 0, include_this_patron => 0) => 0
child 1 debt is correct (only_this_guarantor => 0, include_guarantors => 0, include_this_patron => 0) => 10
That does not make a lot of sense IMO, both returns should be the same. Don't you think?
I'll take a look! Which line numbers are these tests on? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- With only the 2 first patches applied: 153 is( $child_1->relationships_debt({ only_this_guarantor => 0, include_guarantors => 0, include_this_patron => 0 }), 10, 'Family debt is correct' ); 157 is( $child_1->relationships_debt({ only_this_guarantor => 1, include_guarantors => 0, include_this_patron => 0 }), 0, 'Family debt is correct' ); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #28 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #27)
With only the 2 first patches applied:
153 is( $child_1->relationships_debt({ only_this_guarantor => 0, include_guarantors => 0, include_this_patron => 0 }), 10, 'Family debt is correct' );
In this case, we are not specifying only_this_guarantor, and we are specifying not to include this patron, and not to include the guarantors themselves, so the code will total the charges from the guarantors other guarantees. Since the sibling owes 10, the returned value is 10.
157 is( $child_1->relationships_debt({ only_this_guarantor => 1, include_guarantors => 0, include_this_patron => 0 }), 0, 'Family debt is correct' );
This one is much simpler, since only_this_guarantor is specified, but the patron is not a guarantor, there are no guarantors to check. No guarantors means no guarantees so the total returned is 0. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com --- Comment #29 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- This is confusing to me. First, child_1 is not a guarantor so only_this_guarantor should not modify the returned value. Then, in the same logic, only_this_guarantor should not have any effects if include_guarantors is not set. Asking Tomas and Martin for additional feedbacks. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #30 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #29)
This is confusing to me. First, child_1 is not a guarantor so only_this_guarantor should not modify the returned value. Then, in the same logic, only_this_guarantor should not have any effects if include_guarantors is not set.
Asking Tomas and Martin for additional feedbacks.
Shouldn't we just throw an exception on bad combination of parameters? If patron is not a guarantor, we should throw a Koha::Exception::BadParameter if 'only_this_guarantor' is passed, right? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109210|0 |1 is obsolete| | Attachment #109211|0 |1 is obsolete| | Attachment #109349|0 |1 is obsolete| | Attachment #109357|0 |1 is obsolete| | --- Comment #31 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 109634 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109634&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #32 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 109635 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109635&action=edit Bug 19382: Add blocking of ability to checkout on circulation.pl Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #33 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 109636 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109636&action=edit Bug 19382: (QA follow-up) Throw exception if only_this_guarantor is set for a non-guarantor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Signed Off --- Comment #34 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I am sorry Kyle but I really don't think we should push the tests as they are written. We should expect one loop and a sum following some conditions, like I tried in my patch. That will highlight inconsistencies (like the one I raised in the previous comments). Also the amounts are always 10, so we cannot know which ones is really picked (reading the tests I mean). We should improve our test suite, and those tests are not in the right direction in my opinion. Asking for another QA point of view. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #35 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Dang; Improveing the tests here is alluding me so far.. I've tried a few variations of loops and it just ends up getting complicated and obfuscated.. I'm going to have one last try tomorrow but I think we might end up just improving the output messages of the existing tests (and improve the numbers to ensure catching more mathematical variations). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #36 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 109841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109841&action=edit Bug 19382: (follow-up) Alternate tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #37 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Hmm, not sure if my followup improves the tests or not to be honest.. they all pass but I'm not entirely pleased with the set of logic in the middle of the newly introduced sub -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@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=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109841|0 |1 is obsolete| | --- Comment #38 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 109937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109937&action=edit Bug 19382: (follow-up) Alternate tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #39 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- +# 3 params, count from 0 to 6 in binary ( 3 places ) to get the set of switches, then do that 4 times, one for each parent and child + for my $i ( 0 .. 7 ) { Kyle, in a previous patch I replaced "0 to 6" with "0 to 7", but you reverted it. Can you explain? "0 to 7" seems what we are doing here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #40 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- C4/Circulation.pm: my $guarantors_non_issues_charges += $patron->relationships_debt({ include_guarantors => 1, only_this_guaranor => 0, include_this_patron => 1 }); C4/SIP/ILS/Patron.pm: $fines_amount += $patron->relationships_debt({ include_guarantors => 1, only_this_guaranor => 0, include_this_patron => 1 }); circ/circulation.pl: my $guarantors_non_issues_charges += $patron->relationships_debt({ include_guarantors => 1, only_this_guaranor => 0, include_this_patron => 1 }); Looks like there is a typo in the second parameter name. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #41 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #39)
+# 3 params, count from 0 to 6 in binary ( 3 places ) to get the set of switches, then do that 4 times, one for each parent and child + for my $i ( 0 .. 7 ) {
Kyle, in a previous patch I replaced "0 to 6" with "0 to 7", but you reverted it. Can you explain? "0 to 7" seems what we are doing here.
That change was made by Martin. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Kyle M Hall <kyle@bywatersolutions.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=19382 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109634|0 |1 is obsolete| | Attachment #109635|0 |1 is obsolete| | Attachment #109636|0 |1 is obsolete| | Attachment #109937|0 |1 is obsolete| | --- Comment #42 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 111570 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111570&action=edit Bug 19382: Add ability to block guarantees based on fees owed by guarantor and other guarantees Some libraries would like to not only block the circulation of a guarantor based on fines owed by guarantees, but would also like to block circulation for all guarantees as well. Basically, if a family as a whole reaches a certain threshold of fines, the entire family will be blocked from checking out items. Test Plan: 1) Apply this patch 2) Set NoIssuesChargeGuarantorsWithGuarantees to $14 3) Create a family of four ( 2 guarantors, 2 guarantees ) where the parents guarantee both children 4) Give 3 of the 4 a $5 fine 5) None of them should be able to check out items Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #43 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 111571 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111571&action=edit Bug 19382: Add blocking of ability to checkout on circulation.pl Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #44 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 111572 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111572&action=edit Bug 19382: (QA follow-up) Throw exception if only_this_guarantor is set for a non-guarantor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #45 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 111573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111573&action=edit Bug 19382: (follow-up) Alternate tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #46 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 111574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111574&action=edit Bug 19382: (QA follow-up) Fix typos -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #47 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 111609 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111609&action=edit Bug 19382: Adjust comment in test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 --- Comment #48 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |lucas@bywatersolutions.com --- Comment #49 from Lucas Gass <lucas@bywatersolutions.com> --- enhancement will not be backported to 20.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19382 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com Keywords| |Manual-updated -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org