Koha/opac
Hammat Wele a09a926458
Bug 30846: 'If any unavailable' doesn't consider negative notforlan values as unavailable
When we set up a circulation rule where 'On shelf holds allowed' is 'If any unavailable' and we have a record with one 'Ordered' item, we cannot place this item on hold.

This patch allows placing hold on item with negative not for loan values, when using rule with 'On shelf holds allowed' set to 'If any unavailable'

To test:

1. Set up a circulation rule where on shelf holds are not allowed and force the choosing of an item (to facilitate the test)
    1.1. Go to Administration > Circulation and fines rules
    1.2. In the matrix, add a circulation like this
          - Patron category: All
          - Item type: Books
          - Current checkouts allowed: 10
          - Current on-site checkouts allowed: 10
          - Loan period: 21
          - Holds allowed (total): 10
          - Holds allowed (daily): 10
          - Holds per record (count): 10
          - On shelf holds allowed: If any unavailable
          - OPAC item level holds: Force
    1.3. Click Save
2. Create a record with one 'Ordered' item (or any negative value not for loan status)
    2.1. Go to Cataloging
    2.2. Click New record
    2.3. Fill out the mandatory fields (by default in MARC21: 000, 003, 005, 008,  040, 245, and 942 (942 should be set to Books))
    2.4. Click Save
    2.5. Fill out the following item fields
          - Not for loan: Ordered
          - Koha item type: Books
    2.6. Click Add item
    2.7. Click Normal to go to the detailed record
3. Try to place a hold on the 'Ordered' item
    3.1. From the detailed record, click OPAC view: Open in new window.
    --> Note that the 'Place hold' option is not present
4. Add a second 'Available' item
    4.1. Back in the staff interface tab with the detailed record, click New > New item
    4.2. Make sure the item type is set to Books
    4.3. Add a barcode in p
    4.4. Click Add item
5. Try again to place a hold on the 'Ordered' item
    5.1. Go back to the OPAC tab and refresh the page
    --> Note that the 'Place hold' option is still not present
6. Check out the available item to a patron
    6.1. In the staff interface tab, copy the barcode from the available item
    6.2. Go to Patrons
    6.3. Click on Search
    6.4. Click Check out next to one of the patrons
    6.5. Paste the barcode in the box and click Check out
7. Try again to place a hold on the 'Ordered' item
    7.1. Go back to the OPAC tab and refresh the page
    --> Note that the 'Place hold' option is now present
    7.2. Click Place hold
    --> Note that only the checked out item is available to place on hold, if you click Show unholdable items, it will show the Ordered item, but you can't place a hold on it.
8. Apply the patch
9. Go to the OPAC tab and click on the book title right next to 'Place a hold on' checkbox to go back to the record details.
        --> Note that the 'Place hold' option is still present
        9.1. Click Place hold
        --> Note that you can now place a hold on the 'Checked out' or the 'Ordered' item.
10. Check in the item to make it available again
    10.1. In the staff interface tab, click on 'Show checkouts' button
    10.2. Select the Checked out item and click on 'Renew or check in selected items' button.
11. Try again to place a hold on the 'Ordered' item
    11.1. Go back to the OPAC tab and click on the book title right next to 'Place a hold on' checkbox to go back to the record details.
    --> Note that the 'Place hold' option is still present
    11.2. Click Place hold
    --> Note that only the 'Ordered' item is available to place on hold, if you click Show unholdable items, it will show the Available item and you can't place a hold on it.
12. Delete the available item to keep only the Ordered item
    12.1 in the staff interface tab, click on 'Search catalog' and search for the record
    12.2 click on 'Edit' then 'Edit items'
    12.3 Delete the available item
13. Try to place a hold on the remain 'Ordered' item
    13.1 Go back to the OPAC tab and click on the book title right next to 'Place a hold on' checkbox to go back to the record details.
        --> Note that the 'Place hold' option is present
    13.2. Click Place hold
    --> Note that you can place a hold on the Ordered item.

Signed-off-by: Amaury GAU <amaury.gau@bulac.fr>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-08-15 15:14:11 +03:00
..
clubs Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
errors Bug 29420: HTTP status code incorrect when calling error pages directly under Plack/PSGI 2022-04-20 09:03:39 -10:00
external/overdrive Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
sci Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
sco Bug 33444: Update AddRenewal to take a hashref of params 2023-07-19 12:06:52 -03:00
svc Bug 25079: Add a 'edit' functionality to the Clubs tool in the staff interface 2023-06-23 11:00:49 -03:00
ilsdi.pl Bug 30944: Undo change to ILS-DI documentation 2022-10-03 13:44:11 -03:00
maintenance.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
oai.pl
opac-account-pay-return.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-account-pay.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-account.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
opac-addbybiblionumber.pl Bug 30418: Add ability for permitted staff to edit list contents 2023-05-15 18:23:57 -03:00
opac-alert-subscribe.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-article-request-cancel.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-authorities-home.pl Bug 33803: Remove comment about tab width 2023-06-06 09:58:47 -03:00
opac-authoritiesdetail.pl Bug 21330: Allow XSLT for authority detail view in OPAC 2023-05-15 18:24:03 -03:00
opac-basket.pl Bug 33102: Display fields from biblioitems in OPAC/staff interface cart 2023-05-05 17:45:19 -03:00
opac-blocked.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-browse.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-browser.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-changelanguage.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
opac-course-details.pl Bug 32445: (follow-up) Fix availability display on opac-course-details 2023-01-05 09:09:48 -03:00
opac-course-reserves.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-curbside-pickups.pl Bug 30650: Prevent pickup to be created on holiday 2022-07-29 15:00:51 -03:00
opac-detail.pl Bug 30846: 'If any unavailable' doesn't consider negative notforlan values as unavailable 2023-08-15 15:14:11 +03:00
opac-discharge.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-dismiss-message.pl Bug 12029: Remove 'params' from filter_by_unread 2023-04-20 15:48:47 -03:00
opac-downloadcart.pl Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
opac-downloadshelf.pl Bug 33069: Fix error in MARC download for OPAC lists 2023-05-09 10:57:55 -03:00
opac-export.pl Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
opac-holdshistory.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-ics.pl Bug 30927: Improve formatting or iCal files for checkout due dates 2022-08-09 07:39:17 -03:00
opac-idref.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-illrequests.pl Bug 33702: (QA follow-up) Do not crash on borrowernumber 2023-05-29 09:21:51 -03:00
opac-image.pl Bug 33047: Return 404 instead of 500 when biblio does not exist 2023-07-10 15:43:14 -03:00
opac-imageviewer.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-ISBDdetail.pl Bug 30846: 'If any unavailable' doesn't consider negative notforlan values as unavailable 2023-08-15 15:14:11 +03:00
opac-issue-note.pl Bug 29544: (QA follow-up) Simplify code 2022-02-02 21:05:29 -10:00
opac-library.pl Bug 31775: Show single library 2022-10-17 08:25:55 -03:00
opac-main.pl Bug 29691: Use template to display news on opac homepage 2023-06-15 08:48:13 -03:00
opac-MARCdetail.pl Bug 30846: 'If any unavailable' doesn't consider negative notforlan values as unavailable 2023-08-15 15:14:11 +03:00
opac-memberentry.pl Bug 33197: Rename GDPR_Policy system preference 2023-05-05 10:18:54 -03:00
opac-messaging.pl Bug 31743: Change condition for messaging tab 2022-11-04 20:01:13 -03:00
opac-modrequest-suspend.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-modrequest.pl Bug 14783: (QA follow-up) Rename method and move tests 2022-10-17 15:43:22 -03:00
opac-mymessages.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-news-rss.pl Bug 24387: Rename "News" with "Additional contents" 2021-08-16 11:55:55 +02:00
opac-overdrive-search.pl Bug 29318: Tidy the code 2021-10-26 16:46:03 +02:00
opac-page.pl Bug 32251: Add a fallback for when language cookie was removed 2023-01-27 16:20:24 -03:00
opac-passwd.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-password-recovery.pl Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-10-24 14:12:16 -03:00
opac-patron-consent.pl Bug 33197: Rename GDPR_Policy system preference 2023-05-05 10:18:54 -03:00
opac-patron-image.pl Bug 29931: (follow-up) Similar thing in opac-patron-image.pl 2022-03-15 22:30:50 -10:00
opac-privacy.pl Bug 29843: Use in opac/opac-privacy.pl 2022-02-10 14:44:23 -10:00
opac-ratings.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-readingrecord.pl Bug 33951: (QA follow-up) Import GetNormalizedOCLCNumber 2023-06-08 09:02:17 -03:00
opac-recall.pl Bug 30291: Changes to OPAC files 2022-05-05 11:17:36 -10:00
opac-recalls.pl Bug 30291: Changes to OPAC files 2022-05-05 11:17:36 -10:00
opac-registration-verify.pl Bug 33192: Update all occurrences of AutoEmailPrimaryAddress 2023-04-14 11:35:39 -03:00
opac-renew.pl Bug 33444: Update AddRenewal to take a hashref of params 2023-07-19 12:06:52 -03:00
opac-reportproblem.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-request-article.pl Bug 27946: Add UI handling of AR fees 2022-01-28 11:09:07 -10:00
opac-reserve.pl Bug 34178: Cache ItemsAnyAvailableAndNotRestricted in memory and don't precalculate 2023-07-19 13:00:42 -03:00
opac-reset-password.pl Bug 29925: Add a password reset page for expired passwords 2022-05-06 10:33:09 -10:00
opac-restrictedpage.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-retrieve-file.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-review.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-routing-lists.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-search-history.pl Bug 30377: Fix two CGI::param called in list context-warnings 2022-04-04 16:23:46 +02:00
opac-search.pl Bug 34023: Prevent HTML injection in "back to results" link from search page 2023-08-07 21:00:04 -03:00
opac-sendbasket.pl Bug 33223: Replace 'first_valid' with 'notice' for email addresses 2023-05-16 15:17:35 -03:00
opac-sendshelf.pl Bug 33223: Fix sendshelf 2023-05-16 15:17:36 -03:00
opac-serial-issues.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-shareshelf.pl Bug 28959: Fix other cases 2021-10-28 17:47:38 +02:00
opac-shelves.pl Bug 30418: Add ability for permitted staff to edit list contents 2023-05-15 18:23:57 -03:00
opac-showmarc.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-showreviews.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
opac-suggestions.pl Bug 33236: Move NewSuggestion to Koha::Suggestion->store 2023-06-06 10:08:35 -03:00
opac-tags.pl Bug 28375: (follow-up) Use C4::Context->interface 2022-10-20 11:50:53 -03:00
opac-tags_subject.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
opac-topissues.pl Bug 17018: Split AdvancedSearchTypes for staff and OPAC 2022-04-12 17:13:02 +02:00
opac-user.pl Bug 33956: Use Koha::Biblio->opac_summary_html from opac-user.pl 2023-07-13 15:19:39 -03:00
tracklinks.pl Bug 30262: Trim whitespace off tracklinks.pl URLs 2022-08-31 08:46:11 -03:00
unapi Bug 17600: Fix opac/unapi 2021-11-22 11:04:51 +01:00