Bug 16223: Add ability to define liftable restrictions
authorEmmi Takkinen <emmi.takkinen@koha-suomi.fi>
Thu, 22 Sep 2022 09:19:03 +0000 (12:19 +0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 11 Oct 2023 15:13:06 +0000 (12:13 -0300)
commit335f68eb51679fd58b25cf5a563c0cb7b2237dfa
tree6fc8d553d163f6c6ac9c1b11f7ed395afa6587b6
parentc894703b7c160b5b254514626dfc00c73c132e9c
Bug 16223: Add ability to define liftable restrictions

Some libraries debar Patrons at the end of the year for having unpaid fines,
like in Bug 15157. Currently librarians have to manually remove this type of
debarments after Patron has paid his/her fines.

This patch adds ability to create restrictions which are lifted after
patron pays ceratain amount of fines.

To test:
1. Apply this patch.
2. Restart your services if needed.
3. Navigate to page restrictions.pl.
=> Note that table has two new colums in it, "Lift after payment?" and "Fee limit".
4. Add new restriction which has "Lift after payment?" set
as Yes and fee limit as 5.
5. Create fees for a patron so they exceed fee limit e.g. 10
6. Add restriction made in step 2. for the patron
7. Pay patrons fees partially so that they go under fee limit
=> Note that patrons restriction should now be lifted.

Also prove t/db_dependent/Patron/Borrower_Debarments.t.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Account.pm
Koha/Patron/Debarments.pm
admin/restrictions.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt
koha-tmpl/intranet-tmpl/prog/js/restrictiontypes.js
t/db_dependent/Patron/Borrower_Debarments.t