https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28924

Matt Blenkinsop <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #167722|0                           |1
        is obsolete|                            |

--- Comment #44 from Matt Blenkinsop <[email protected]> ---
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 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to