[Bug 27259] New: HomeOrHoldingBranch is not used in all places
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Bug ID: 27259 Summary: HomeOrHoldingBranch is not used in all places Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: joonas.kylmala@helsinki.fi QA Contact: testopia@bugs.koha-community.org If you grep for CircControl in Koha source code you will find that there are few places that are missing the check for HomeOrHoldingBranch and just use item's homebranch. This for example leads to calculating renewability and fines with rules from item's homebranch and not from the holdingbranch as was wanted. -- 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=27259 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=27259 --- Comment #1 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 114591 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114591&action=edit Bug 27259: Test HomeOrHoldingBranch usage in TooMany() This shows that HomeOrHoldingBranch syspref is incorrectly not used by TooMany() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/TooMany.t" to notice the tests now fail. -- 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=27259 --- Comment #2 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 114592 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114592&action=edit Bug 27259: Test HomeOrHoldingBranch usage in _CalculateAndUpdateFine() This shows that HomeOrHoldingBranch syspref is incorrectly not used by _CalculateAndUpdateFine() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t" to notice the tests now fail. -- 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=27259 --- Comment #3 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 114593 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114593&action=edit Bug 27259: Add HomeOrHoldingBranch checks where it was missing from The TooMany() function and fine calculation functions were incorrectly hard coded to use homebranch for fetching the circulation rules. Those ignored completely the syspref HomeOrHoldingBranch where the user might have set it to holdingbranch and therefore the fines and whether patron has too many checkouts (TooMany()) were counted using the unintended branch's rules. This problem only arises in the cases where there are branch specific circulation rules defined. Test plan: 1. Make sure following tests pass: $ prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t $ prove t/db_dependent/Circulation/TooMany.t Test plan for fines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with home and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl /usr/share/koha/bin/cronjobs/fines.pl 6. Notice that fines have popped up now to the patron incorrectly 7. Apply patch 8. Pay fines, Check-in the item and check it out again 9. Run perl /usr/share/koha/bin/cronjobs/fines.pl 10. Notice that fine is now 0. This means that the branch B (holdingbranch of the checked-out item) specific rule is used. Test plan for staticfines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with homebranch A and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice that now there is inccorectly fines 6. Apply patch 7. Pay fines, Check-in the item and check it out again 8. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice the fines are now not generated -- 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=27259 Andrew Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nugged@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |joonas.kylmala@helsinki.fi |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=27259 Andrew Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114591|0 |1 is obsolete| | Attachment #114592|0 |1 is obsolete| | Attachment #114593|0 |1 is obsolete| | --- Comment #4 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 133700 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133700&action=edit Bug 27259: Test HomeOrHoldingBranch usage in TooMany() This shows that HomeOrHoldingBranch syspref is incorrectly not used by TooMany() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/TooMany.t" to notice the tests now fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 --- Comment #5 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 133701 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133701&action=edit Bug 27259: Test HomeOrHoldingBranch usage in _CalculateAndUpdateFine() This shows that HomeOrHoldingBranch syspref is incorrectly not used by _CalculateAndUpdateFine() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t" to notice the tests now fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 --- Comment #6 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 133702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133702&action=edit Bug 27259: Add HomeOrHoldingBranch checks where it was missing from The TooMany() function and fine calculation functions were incorrectly hard coded to use homebranch for fetching the circulation rules. Those ignored completely the syspref HomeOrHoldingBranch where the user might have set it to holdingbranch and therefore the fines and whether patron has too many checkouts (TooMany()) were counted using the unintended branch's rules. This problem only arises in the cases where there are branch specific circulation rules defined. Test plan: 1. Make sure following tests pass: $ prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t $ prove t/db_dependent/Circulation/TooMany.t Test plan for fines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with home and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl /usr/share/koha/bin/cronjobs/fines.pl 6. Notice that fines have popped up now to the patron incorrectly 7. Apply patch 8. Pay fines, Check-in the item and check it out again 9. Run perl /usr/share/koha/bin/cronjobs/fines.pl 10. Notice that fine is now 0. This means that the branch B (holdingbranch of the checked-out item) specific rule is used. Test plan for staticfines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with homebranch A and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice that now there is inccorectly fines 6. Apply patch 7. Pay fines, Check-in the item and check it out again 8. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice the fines are now not generated Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Thibault Keromnès <thibault.keromnes@univ-paris8.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |thibault.keromnes@univ-pari | |s8.fr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Andrew Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #133700|0 |1 is obsolete| | Attachment #133701|0 |1 is obsolete| | Attachment #133702|0 |1 is obsolete| | --- Comment #7 from Andrew Nugged <nugged@gmail.com> --- Created attachment 140388 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140388&action=edit Bug 27259: Add HomeOrHoldingBranch checks where it was missing from The TooMany() function and fine calculation functions were incorrectly hard coded to use homebranch for fetching the circulation rules. Those ignored completely the syspref HomeOrHoldingBranch where the user might have set it to holdingbranch and therefore the fines and whether patron has too many checkouts (TooMany()) were counted using the unintended branch's rules. This problem only arises in the cases where there are branch specific circulation rules defined. Test plan: 1. Make sure following tests pass: $ prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t $ prove t/db_dependent/Circulation/TooMany.t Test plan for fines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with home and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl /usr/share/koha/bin/cronjobs/fines.pl 6. Notice that fines have popped up now to the patron incorrectly 7. Apply patch 8. Pay fines, Check-in the item and check it out again 9. Run perl /usr/share/koha/bin/cronjobs/fines.pl 10. Notice that fine is now 0. This means that the branch B (holdingbranch of the checked-out item) specific rule is used. Test plan for staticfines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with homebranch A and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice that now there is inccorectly fines 6. Apply patch 7. Pay fines, Check-in the item and check it out again 8. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice the fines are now not generated Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Andrew Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140388|0 |1 is obsolete| | --- Comment #8 from Andrew Nugged <nugged@gmail.com> --- Created attachment 140389 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140389&action=edit Bug 27259: Test HomeOrHoldingBranch usage in TooMany() This shows that HomeOrHoldingBranch syspref is incorrectly not used by TooMany() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/TooMany.t" to notice the tests now fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 --- Comment #9 from Andrew Nugged <nugged@gmail.com> --- Created attachment 140390 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140390&action=edit Bug 27259: Test HomeOrHoldingBranch usage in _CalculateAndUpdateFine() This shows that HomeOrHoldingBranch syspref is incorrectly not used by _CalculateAndUpdateFine() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t" to notice the tests now fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 --- Comment #10 from Andrew Nugged <nugged@gmail.com> --- Created attachment 140391 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140391&action=edit Bug 27259: Add HomeOrHoldingBranch checks where it was missing from The TooMany() function and fine calculation functions were incorrectly hard coded to use homebranch for fetching the circulation rules. Those ignored completely the syspref HomeOrHoldingBranch where the user might have set it to holdingbranch and therefore the fines and whether patron has too many checkouts (TooMany()) were counted using the unintended branch's rules. This problem only arises in the cases where there are branch specific circulation rules defined. Test plan: 1. Make sure following tests pass: $ prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t $ prove t/db_dependent/Circulation/TooMany.t Test plan for fines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with home and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl /usr/share/koha/bin/cronjobs/fines.pl 6. Notice that fines have popped up now to the patron incorrectly 7. Apply patch 8. Pay fines, Check-in the item and check it out again 9. Run perl /usr/share/koha/bin/cronjobs/fines.pl 10. Notice that fine is now 0. This means that the branch B (holdingbranch of the checked-out item) specific rule is used. Test plan for staticfines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with homebranch A and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice that now there is inccorectly fines 6. Apply patch 7. Pay fines, Check-in the item and check it out again 8. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice the fines are now not generated Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 --- Comment #11 from Andrew Nugged <nugged@gmail.com> --- rebased to latest master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Peter Vashchuk <stalkernoid@gmail.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=27259 Peter Vashchuk <stalkernoid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140389|0 |1 is obsolete| | Attachment #140390|0 |1 is obsolete| | Attachment #140391|0 |1 is obsolete| | --- Comment #12 from Peter Vashchuk <stalkernoid@gmail.com> --- Created attachment 141021 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141021&action=edit Bug 27259: Test HomeOrHoldingBranch usage in TooMany() This shows that HomeOrHoldingBranch syspref is incorrectly not used by TooMany() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/TooMany.t" to notice the tests now fail. Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 --- Comment #13 from Peter Vashchuk <stalkernoid@gmail.com> --- Created attachment 141022 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141022&action=edit Bug 27259: Test HomeOrHoldingBranch usage in _CalculateAndUpdateFine() This shows that HomeOrHoldingBranch syspref is incorrectly not used by _CalculateAndUpdateFine() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t" to notice the tests now fail. Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 --- Comment #14 from Peter Vashchuk <stalkernoid@gmail.com> --- Created attachment 141023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141023&action=edit Bug 27259: Add HomeOrHoldingBranch checks where it was missing from The TooMany() function and fine calculation functions were incorrectly hard coded to use homebranch for fetching the circulation rules. Those ignored completely the syspref HomeOrHoldingBranch where the user might have set it to holdingbranch and therefore the fines and whether patron has too many checkouts (TooMany()) were counted using the unintended branch's rules. This problem only arises in the cases where there are branch specific circulation rules defined. Test plan: 1. Make sure following tests pass: $ prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t $ prove t/db_dependent/Circulation/TooMany.t Test plan for fines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with home and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl /usr/share/koha/bin/cronjobs/fines.pl 6. Notice that fines have popped up now to the patron incorrectly 7. Apply patch 8. Pay fines, Check-in the item and check it out again 9. Run perl /usr/share/koha/bin/cronjobs/fines.pl 10. Notice that fine is now 0. This means that the branch B (holdingbranch of the checked-out item) specific rule is used. Test plan for staticfines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with homebranch A and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice that now there is inccorectly fines 6. Apply patch 7. Pay fines, Check-in the item and check it out again 8. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice the fines are now not generated Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|katrin.fischer@bsz-bw.de |testopia@bugs.koha-communit | |y.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141021|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 143013 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143013&action=edit Bug 27259: Test HomeOrHoldingBranch usage in TooMany() This shows that HomeOrHoldingBranch syspref is incorrectly not used by TooMany() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/TooMany.t" to notice the tests now fail. Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> 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=27259 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141022|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 143014 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143014&action=edit Bug 27259: Test HomeOrHoldingBranch usage in _CalculateAndUpdateFine() This shows that HomeOrHoldingBranch syspref is incorrectly not used by _CalculateAndUpdateFine() when it decides which circ rule to use. Run "prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t" to notice the tests now fail. Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> 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=27259 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141023|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 143015 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143015&action=edit Bug 27259: Add HomeOrHoldingBranch checks where it was missing from The TooMany() function and fine calculation functions were incorrectly hard coded to use homebranch for fetching the circulation rules. Those ignored completely the syspref HomeOrHoldingBranch where the user might have set it to holdingbranch and therefore the fines and whether patron has too many checkouts (TooMany()) were counted using the unintended branch's rules. This problem only arises in the cases where there are branch specific circulation rules defined. Test plan: 1. Make sure following tests pass: $ prove t/db_dependent/Circulation/_CalculateAndUpdateFine.t $ prove t/db_dependent/Circulation/TooMany.t Test plan for fines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with home and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl /usr/share/koha/bin/cronjobs/fines.pl 6. Notice that fines have popped up now to the patron incorrectly 7. Apply patch 8. Pay fines, Check-in the item and check it out again 9. Run perl /usr/share/koha/bin/cronjobs/fines.pl 10. Notice that fine is now 0. This means that the branch B (holdingbranch of the checked-out item) specific rule is used. Test plan for staticfines.pl: 1. Add branch specific fine rules for branches A and B. A having a fine of 1 per day and B having a fine of 0 per day. 2. Set sysprefs: CircControl = the library the items is from finesMode = Calculate and charge HomeOrHoldingBranch = holdingbranch 3. Create an item with homebranch A and holding branch of A 4. Checkout the item with a due date in the past (the past due date can be specified by clicking "Checkout settings" in the checkout page) and make sure the branch you are checking from is B. 5. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice that now there is inccorectly fines 6. Apply patch 7. Pay fines, Check-in the item and check it out again 8. Run perl staticfines.pl --library A --library B --category <PATRONS_CATEGORYCODE> and notice the fines are now not generated Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com> 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=27259 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nicely worked through.. good to see unit tests and qa script is happy. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27259 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.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=27259 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org