Bug 23091: Add handling for new lostreturn rules
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 23 Oct 2019 10:32:28 +0000 (11:32 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 6 Nov 2020 14:55:17 +0000 (15:55 +0100)
commit7a07e111288de820e535dd35c024917d141129ad
tree032cf7367d398f3de756a6fde5e20249e9cd8c0a
parented0df15f5094c5cf5462488fd0aac48ddd613b35
Bug 23091: Add handling for new lostreturn rules

This patch adds handing for the new values available for the lostreturn
policy settings.

* undef - Do nothing, leave fees and fines as they were at the point of
  lose.
* refund - Refund the lost item fee only
* charge - Refund the lost item fee and charge a fresh overdue fine
  dated for a return on the date the item is 'found'
* restore - Refund the lost item fee and restore the original overdue
  fine (dated for a 'return' on the date the item was 'lost'

Test plan
1/ apply patch
2/ updatedatabase, restart_all
3/ verify finesmode and CalculateFinesOnReturn and WhenLostChargeReplacementFee are on
4/ verify WhenLostForgiveFine is set to "Forgive"
5/ verify circ rules include fines
6/ set Default lost item fee refund on return policy to "Refund lost item charge"
7/ create 4 overdue checkouts that will incur fines
8/ run fines.pl
9/ confirm 4 items checked out with accruing fines
10/ confirm all 4 items have a replacement price

Item 1
11/ mark the first item lost
12/ verify that fine is gone and lost fee has been charged
13/ check item in
14/ verify that lost fee is gone and overdue charge has not returned

Item 2
15/ set Default lost item fee refund on return policy to "Refund lost item charge and charge new overdue fine"
16/ mark second item lost
17/ verify that fine is gone and lost fee has been charged
18/ check item in
19/ verify that lost fee is gone and a new overdue charge has been made

Item 3
20/ set Default lost item fee refund on return policy to "Refund lost item charge and restore overdue fine"
21/ mark third item lost
22/ verify that fine is gone and lost fee has been charged
23/ check item in
24/ verify that lost fee is gone and the old overdue charge has been restored

Item 4
25/ set Default lost item fee refund on return policy to "Leave lost item charge"
26/ mark fourth item lost
27/ verify that fine is gone and lost fee has been charged
28/ check item in
29/ verify that lost fee remains and the overdue charge is still gone

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Circulation.pm
Koha/CirculationRules.pm
admin/smart-rules.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt