Koha/C4
David Cook 5d7a9395fb
Bug 31427: Get auto renewal errors before other renewal errors
This patch changes CanBookBeRenewed so that automatic renewal
errors pop up before other renewal errors. This means that a book
will be considered "auto_too_soon" before things like "too_many" or
"restricted". (Otherwise, you'll get an email saying you can't renew
a book the day after using your last auto renewal, even though the
earliest renewal isn't available until later.)

Test plan:
0. Apply patch
1. prove t/db_dependent/Circulation.t
2. prove t/db_dependent/Holds.t
3. prove t/db_dependent/Koha/Account/Line.t
4. prove t/db_dependent/Koha/Account.t

Additional tests:
5. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RestrictionBlockRenewing
6. Change to "block"
7. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=AutoRenewalNotices
8. Change to "according to patron messaging preferences"
9. Go to http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl
10. Set "Automatic renewal" to "Yes" and "No renewal before" to 4
11. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
12. Checkout 39999000001310 with a due date 4 days in the future
13. Add a manual restriction
14. Run `perl ./misc/cronjobs/automatic_renewals.pl`
15. Note that it says something like the following:
Issue id: 1237 for borrower: 51 and item: 73 would not be renewed. (auto_too_soon)

Instead of something like the following:
Issue id: 1237 for borrower: 51 and item: 73 would not be renewed. (restriction)

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-03-07 16:36:43 +01:00
..
AuthoritiesMarc
Barcodes Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
ClassSortRoutine
ClassSplitRoutine
Creators
External
Form
Heading
ILSDI
Installer
Labels Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
Linker
Members
OAI
Output
Patroncards
Reports
Search
Serials Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SIP Bug 35461: Fix function call parameters causing the HASH to show in the renew all responses 2024-01-26 15:13:57 +01:00
Utils/DataTables
Accounts.pm
Acquisition.pm
Auth.pm
Auth_cas_servers.yaml.sample
Auth_with_cas.pm
Auth_with_ldap.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-02-02 17:31:46 +01:00
Auth_with_shibboleth.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-02-02 17:31:46 +01:00
AuthoritiesMarc.pm
Barcodes.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblio.pm
Breeding.pm
Budgets.pm
Calendar.pm
Charset.pm
Circulation.pm Bug 31427: Get auto renewal errors before other renewal errors 2024-03-07 16:36:43 +01:00
ClassSortRoutine.pm Bug 29951: Fix EXPORT for C4::ClassS*Routine modules 2022-07-08 15:29:56 -03:00
ClassSource.pm
ClassSplitRoutine.pm
Context.pm
Contract.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
CourseReserves.pm
Creators.pm
Heading.pm
HoldsQueue.pm
HTML5Media.pm
ImportBatch.pm Bug 35438: Remove skip_intermediate_commit parameter 2024-01-16 12:06:08 +01:00
ImportExportFramework.pm
InstallAuth.pm
Installer.pm
ItemCirculationAlertPreference.pm
Items.pm
Koha.pm Bug 35833: Fix warnings from C4/Koha 2024-01-29 12:24:58 +01:00
Labels.pm
Languages.pm Bug 32775: (QA follow-up) Fix tab and indenting issues 2023-05-15 18:23:54 -03:00
Letters.pm Bug 18397: Add message delivery details to the notices tab 2024-01-31 14:44:42 +01:00
Linker.pm
Log.pm
MarcModificationTemplates.pm
Matcher.pm Bug 26611: Make authority record matching use required match checks 2023-05-24 11:21:31 -03:00
Members.pm
Message.pm
Output.pm
Overdues.pm
Patroncards.pm
Record.pm
Reports.pm
Reserves.pm
Ris.pm
RotatingCollections.pm
Scheduler.pm
Scrubber.pm
Search.pm
Serials.pm
Service.pm
ShelfBrowser.pm Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
SMS.pm
SocialData.pm Bug 33833: Add two FIXMEs to SocialData::get_report 2023-09-05 14:35:35 -03:00
Stats.pm
Suggestions.pm
Tags.pm
Templates.pm
TmplToken.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
TmplTokenType.pm
TTParser.pm Bug 26673: Remove #!/usr/bin/env perl from .pm modules too 2020-10-26 00:14:42 +01:00
UsageStats.pm Bug 33961: Remove built-in offline circ tool 2023-06-12 16:53:25 -03:00
XISBN.pm
XSLT.pm