Bug 15705: Reset the last error when an auto renew successes
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 30 Mar 2017 16:55:36 +0000 (13:55 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 9 May 2017 21:09:08 +0000 (21:09 +0000)
commit97b43e633d658fee6020756d7e068415940a68cb
tree8f44da3b86b8ec9cb192e53cb579f005c23afb16
parentee53560da63af149815c876369b747f932ba397b
Bug 15705: Reset the last error when an auto renew successes

The auto_renew_error has to be reset when an auto renew successes,
otherwise the patron is not going to receive the correct notice.

Test plan;
- Checkin an item and mark it as auto renewal (specify a due date in the past to allow auto renewals)
- Set OPACFineNoRenewalsBlockAutoRenew to 'Block' and 'OPACFineNoRenewals' to '1'
- Execute the script
=> Auto renewed, column auto_renew_error is null
- Add a fine of '2' to the patron
- Execute the script
=> Not auto renewed, column auto_renew_error is 'auto_too_much_oweing'
=> On the interface youo see the correct message "Automatic renewal failed, patron has unpaid fines"
- Pay the fine
- Execute the script

Without this patch the auto_renew_error is not reset and the patron is going to
receive a letter telling him he own too much money to the library
With this patch the patron will receive a letter to inform him the renew has been done!

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
misc/cronjobs/automatic_renewals.pl