Bug 29012: Add default values for blank circulation rules that weren't saved to the...
authorKevin Carnes <kevin.carnes@ub.lu.se>
Fri, 3 Dec 2021 09:49:59 +0000 (09:49 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 29 Jul 2022 18:44:39 +0000 (15:44 -0300)
commitcf397ac3bcbc93a508954c836d1cb90a84fb2ac6
tree3d02faddc3d82d63677f3e5f597a312fd4d2167a
parentd5e65dd4c0352c4fb2d96f4cabfc6e6311770cd0
Bug 29012: Add default values for blank circulation rules that weren't saved to the database

There are 5 fields that are not set if no value is provided when saving/editing a rule in Administration->Circulation and fines rules
- issuelength
- hardduedate
- unseenrenewalsallowed
- rentaldiscount
- decreaseloanholds

This is problematic because it gives the impression these rules are set as blank, but in reality they don't exist and the rule will fal back to the higher level

To test:
1 - Set a rule for
    Patron category: Teacher
    Itemtype: All
    Hard due date: (Today)
    Lona period: 10
2 - Set a rule for
    Patron category: Teacher
    Itemtype: Books
    Hard due date: (leave blank)
    Loan period: 10
3 - Expected behaviour is Book item will checkout to teacher for 10 days, all other types will be due yesterday at 25:59:00
4 - Checkout an non-book item type to teacher
5 - Hard due date applies
6 - Checkout a 'book' item type to teacher
7 - Hard due date applies - FAIL

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Circulation.pm
admin/smart-rules.pl
installer/data/mysql/atomicupdate/bug_29012.pl [new file with mode: 0755]
installer/onboarding.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt