Koha/C4
Andrew Nugged 4599fcc59d Bug 24683: Fix for take smart rules into account in "if all unavailable"
Inside of ItemsAnyAvailableAndNotRestricted was no effect from main set
of smart rules (per record and other limits): i.e. call to
"CanItemBeReserved" was absent totally.

Because of this there was a bug: for example none of two items were
allowed to be held when first was allowed by one smart rule, BUT on loan,
and second was disallowed by another smart rule (for example,
0 "Holds per record"),

i.e. in this case both items unavailable: so on-shelf holds setting
"allow hold if all unavailable" should allow to hold first one, and not
the second one. But it was that both wasn't allowed to be held.

Solution: call to sub "CanItemBeReserved" added so it checked for
"...->{status} ne 'OK'" so now if item restricted by smart rule it also
accounted as "unavailable" and "AnyAvailavble" not counts it.

How to reproduce:

1. Add 2 smart rules (/cgi-bin/koha/admin/smart-rules.pl) with "on shelf
   holds": "if all unavailable" for all rules, no "item level holds", and
   set "holds per record" to 2 for "books" and "0" for "computer files".

2. Create only 2 items for one biblio, but different types, "book"
   and "computer file". For example in misc4dev env:
   /cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additem

3. Check out that item of type "book" to some person, for example,
   in misc4dev:
   /cgi-bin/koha/circ/circulation.pl?borrowernumber=2&barcode=3999900000001

4. Open reserve/request, for example, for item 1 and patron 1 in misc4dev
   env (/cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=1)

5. It does not allow to hold, both red crossed, but computer file says
   "Exceeded max holds per record" because of "0" limit set on step 1.

6. Apply the patch.

7. Reload page on step 5 and see that "book" will be available for hold,
   but "computer file" still will be red-crossed "Exceeded max holds
   per record", now that's correct because both items unavailable:
   one because on load, another because of "0" limit for computer files.

8. Check-in book from step 3 so it will be returned to the library,

9. Reload page on step 5 and see that again no any holds available,
   but it's now also correct: "book" now returned but "on shelf holds"
   set to "if all unavailable".

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-08-24 10:12:45 +02:00
..
AuthoritiesMarc
Barcodes Bug 21395: Fix C4/Barcodes/ValueBuilder.pm 2020-06-29 15:43:41 +02:00
ClassSortRoutine
ClassSplitRoutine Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Creators Bug 25852: Improve C4::Creators::Lib reliability under plack 2020-07-31 10:03:26 +02:00
External
Form
Heading
ILSDI Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve 2020-05-05 11:03:33 +01:00
Installer
Labels Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Linker Bug 25189: Don't create authority if results found 2020-06-24 14:31:37 +02:00
Members Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
OAI
Output
Patroncards Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Reports
Search
Serials
SIP Bug 25348: Add support for circulation status 12 ( lost ) 2020-08-13 10:15:33 +02:00
Utils Bug 15400: Display date of birth and age more consistantly 2020-06-29 12:37:02 +02:00
Accounts.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Acquisition.pm Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded 2020-07-09 11:50:42 +02:00
Auth.pm Bug 24201: (QA follow-up) Correct call to set_userenv 2020-08-07 16:54:40 +02:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Auth_with_ldap.pm
Auth_with_shibboleth.pm
AuthoritiesMarc.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 26133: Remove GetMarcHosts 2020-08-05 17:36:28 +02:00
Boolean.pm
Breeding.pm Bug 23542: Fix SRU import encoding 2020-08-12 11:46:25 +02:00
Budgets.pm
Calendar.pm Bug 25723: (QA follow-up) Handle holiday and exception on same day 2020-07-20 17:45:31 +02:00
Charset.pm
Circulation.pm Bug 18501: set the is_refunded flag as internal var 2020-08-20 12:31:59 +02:00
ClassSortRoutine.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 24201: Attach desk to intranet session 2020-08-07 16:54:40 +02:00
Contract.pm
CourseReserves.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Creators.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Debug.pm
Heading.pm
HoldsQueue.pm Bug 25799: Add edition information to "Holds queue" report 2020-07-20 17:45:31 +02:00
HTML5Media.pm Bug 20783: Use iframe to embed Youtube videos 2020-06-15 10:32:43 +02:00
Images.pm
ImportBatch.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
ImportExportFramework.pm
InstallAuth.pm Bug 21395: (QA follow-up) POD fixes 2020-06-29 12:37:02 +02:00
Installer.pm
ItemCirculationAlertPreference.pm
Items.pm Bug 24134: Add placeholder for 2 digit years to allow autogeneration of dates in 008 2020-08-13 07:55:44 +02:00
Koha.pm Bug 16371: Move GetDailyQuote to get_daily_quote 2020-08-13 10:15:33 +02:00
Labels.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Languages.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Letters.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Linker.pm
Log.pm Bug 23632: Remove C4::Logs::GetLogs 2020-08-18 15:45:48 +02:00
MarcModificationTemplates.pm
Matcher.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Members.pm
Message.pm
NewsChannels.pm
Output.pm Bug 11994: OpenSearch plugins needs to be delivered with Content-Type application/opensearchdescription+xml 2020-06-24 14:31:37 +02:00
Overdues.pm Bug 25127: Use Koha::Number::Price->round for comparison 2020-05-01 15:44:55 +01:00
Patroncards.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Record.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Reports.pm
Reserves.pm Bug 24683: Fix for take smart rules into account in "if all unavailable" 2020-08-24 10:12:45 +02:00
Ris.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
RotatingCollections.pm Bug 23695: Set holding branch to transferring branch when manually initiating a transfer 2020-08-18 15:45:48 +02:00
Scheduler.pm
Scrubber.pm
Search.pm Bug 23086: Search for collection is broken 2020-07-27 17:24:26 +02:00
Serials.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Service.pm
ShelfBrowser.pm
SMS.pm
SocialData.pm
Stats.pm Bug 24151: Copy info to the pseudonymized table when a transaction is done 2020-07-20 15:17:42 +02:00
Suggestions.pm
Tags.pm
Templates.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
TmplToken.pm
TmplTokenType.pm
TTParser.pm Bug 25305: Translation process - Open all files specifying the utf8 encoding 2020-05-04 08:50:07 +01:00
UsageStats.pm Bug 24159: Move useDaysMode pref to circulation rules 2020-06-25 10:51:59 +02:00
XISBN.pm
XSLT.pm