Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test
authorAndrew Isherwood <andrew.isherwood@ptfs-europe.com>
Wed, 9 Oct 2019 14:13:54 +0000 (15:13 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 6 Mar 2020 10:03:34 +0000 (10:03 +0000)
commita2449a81be55aa5b3710ca2c6df7884513f89540
treeac679e3dd2880f398df2f948184f2b8c92e9fe6a
parentd26a10c1fedf55a7e85387e6555601e41db0e043
Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test

Rebasing was a nightmare, so I'm squashing the sign off follow-ups to
ease the pain with any future rebases

Includes:

Bug 23051: (follow-up) Refactor renewal code
As per Nick's first point in comment #20, the code that tests for
renewability and renews items has been refactored into it's own
function.

Bug 23051: (follow-up) Provide feedback
For renewals that fail when a fine is being paid off, this patch causes
any errors to be passed back to the template for display.
Addresses the second point in Nick's comment #20

Bug 23051: (follow-up) Fix unit tests
As raised by Nick in comment #35

Bug 23051: (follow-up) Fix/improve feedback
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- it would be nice to get feedback on what was successfully renewed as well
- In general I think I would prefer to see 'ok' and 'not_ok' returned as
a single 'renewal_results' array
- There is no listing of errors if I use the 'pay' button on an
individual fine

Bug 23051: (follow-up) Refactor methods
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- I don't really like that the functions are internal functions and then
exported
- I think the pref description should highlight that if 'RenewalPeriodBase'
is set to due date, there may be doubled charges

Bug 23051: (follow-up) Add SIP summary
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- Ideally SIP would get feedback in a screen message

Bug 23051: (follow-up) Renewing in OPAC
This follow up patch addresses the following parts of Nick's feedback in
comment #35:
- I am also not sure about the code path if a patron paid fines on the
opac (via paypal etc.) but renewals are not allowed on the opac.

We've introduced the syspref RenewAccruingItemInOpac (default is off)
which, when enabled, will cause items attached to fines that are paid
off in the OPAC (via payment plugins), to be automatically renewed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20 files changed:
C4/SIP/ILS.pm
C4/SIP/ILS/Transaction/FeePayment.pm
C4/SIP/Sip/MsgType.pm
Koha/Account.pm
Koha/Account/Line.pm
Koha/REST/V1/Patrons/Account.pm
installer/data/mysql/atomicupdate/bug_23051_add_RenewAccruingItemInOpac_syspref.perl [new file with mode: 0644]
installer/data/mysql/atomicupdate/bug_23051_add_RenewAccruingItemWhenPaid_syspref.perl
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/includes/renew_results.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/renew_strings.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt
members/boraccount.pl
members/pay.pl
members/paycollect.pl
t/db_dependent/Accounts.t
t/db_dependent/Koha/Account.t
t/db_dependent/Koha/Account/Line.t