Koha-clms/C4
Lari Taskula c98d1c08a0
Bug 7376: Transfer limits should be checked at check-in
Test case:
 * UseBranchTransferLimits must be set
 * define your branch transfer limit. Refuse transfers from libraryA to libraryB
 * checkout a book owned by libraryB, from libraryB, with a librarian located at libraryB
 * move the librarian to libraryA ("Set Library" link top/right)
 * check-in the book => it's possible whatever your setup

After the patch, the behaviour respect the branch transfer limit parameter:
you can check-in if you accept transfers, you can't if you refuse them.

(Note: IndependantBranches must be OFF, otherwise it's not possible to do the checkin whatever the branch transfer limits)

TEST PLAN:
Note: older signoffs did not validate this test plan

Considering you use a ktd-like database.
Log in at centerville
Allow transfers between centerville, Midway and Franklin, don't allow transfers between Fairfield, Liberty and all other libraries. In addition, allow the transfer between Liberty and Midway

Transfer as much books as you can from Centerville to Midway.
Log in as Midway, check out as many books from Centerville as you can to Henry Acevedo. If you don't have enough books during the test plan, feel free to check out books again. During the whole test, without further precision, items checkout out in such conditions should be checked in.
You will also need 6 checked out floating books at midway

Note:
'-> ok' means the checkin is allowed
'-> not ok' means the checkin is not allowed

Apply patch
I - Test AllowReturnToBranch
    During this part of the test plan, you want to have all following configuration :
    'CircControlReturnsBranch' -> 'The library the item is checked in at'
    In CIRC rules: 'Default holds policy and return policy' -> 'Item returns home' (make sure you have no other holds policy on any library)
    'AllowReturnToBranch' -> as follows
    1 - Set to "Either at the library the item is from or at the library the item was checked out from"
X        a - Check in to Centerville -> ok
X        b - Check in to Midway -> ok
X        c - Check in to Franklin -> not ok
X        d - Check in to Fairfield -> not ok
    2 - Set to "Only at the library the item was checked out from"
X        a - Check in to Centerville -> not ok
X        b - Check in to Midway -> ok
X        c - Check in to Franklin -> not ok
X        d - Check in to Fairfield -> not ok
    3 - Set to "Only at the library the item is from"
X        a - Check in to Centerville -> ok
X        b - Check in to Midway -> not ok
X        c - Check in to Franklin -> not ok
X        d - Check in to Fairfield -> not ok
    4 - Set to "Any library"
X        a - Check in to Centerville -> ok
X        b - Check in to Midway -> ok
X        c - Check in to Franklin -> ok
X        d - Check in to Fairfield -> not ok

II - Transfer and check out 6 floating items at midway.
    1 -
X        a - Check in to Centerville -> ok
X        b - Check in to Midway -> ok
X        c - Check in to Franklin -> ok
X        d - Check in to Fairfield -> ok
    2 - Set 'AllowReturnToBranch' to 'home library'
X        a - Check in to Centerville -> ok
X        b - Check in to Midway -> not ok

III - Pathological & asymetrical cases.
    During this part of the test plan, you want to have all following configuration :
    'CircControlReturnsBranch' -> 'The library the item is checked in at'
    'Default holds policy and return policy' -> 'Item returns home' (make sure you have no other holds policy on any library)
    'AllowReturnToBranch' -> 'Any library'
    FOR THIS PART OF THE TESTS ONLY (until IV): Don't allow tranfers from midway to centerville, but allow from centerville to midway
X        1 - Check in a book at midway -> not ok
    Set 'Default holds policy and return policy' -> 'Item returns to issuing library'
X        2 - Check in a book at centerville -> ok
    FOR THIS PART OF THE TESTS ONLY (until IV): Don't allow tranfers from centerville to midway
X        3 - Check in a book at centerville -> not ok
X        4 - Set 'AllowReturnToBranch' to "Only at the library the item was checked out from"
X            a - check in to Centerville -> not ok
X            b - check in to Midway -> not ok

IV - Test 'CircControlReturnsBranch'
    (remove the precedent transfer restriction)
    During this part of the test plan, you want to have all following configuration :
    'Default holds policy and return policy' -> 'Item returns home' (unchanged)
    'Default checkout, hold and return policy for Midway' -> 'Item returns to issuing library'
    'Default checkout, hold and return policy for Franklin' -> 'Item floats'
    'Default checkout, hold and return policy for Fairfield' -> 'Item returns to issuing library'
    'Default checkout, hold and return policy for Liberty' -> 'Item returns home'
    'AllowReturnToBranch' -> "Any library" (unchanged)
    'CircControlReturnsBranch' -> as follows
    1 - 'The library the item is checked in at'
X        a - Check in to Centerville -> ok
X        b - Check in to Midway -> ok
X        c - Check in to Franklin -> ok
X        d - Check in to Fairfield -> not ok
X        e - Check in to Liberty -> not ok
    2 - 'The library the current item is held by
X        a - Check in to Centerville -> ok
X        b - Check in to Midway -> ok
X        c - Check in to Franklin -> ok
X        d - Check in to Fairfield -> not ok
X        e - Check in to Liberty -> ok
    3 - 'the library the item is owned by'
X        a - Check in to Centerville -> ok
X        b - Check in to Midway -> ok
X        c - Check in to Franklin -> ok
X        d - Check in to Fairfield -> not ok
X        e - Check in to Liberty -> not ok

Sponsored-by: National Library of Finland
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Mathieu Saby <mathsabypro@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:20 -07:00
..
AuthoritiesMarc Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Barcodes Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ClassSortRoutine Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ClassSplitRoutine Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Creators Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
External Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Form Bug 28308: Remove 0 from "days in advance" for "Advance notice" 2026-01-30 10:54:02 -07:00
Heading Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ILSDI Bug 40622: Add missing interface parameter 2025-10-06 09:15:27 -06:00
Installer Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Labels Bug 40473: Use better algorithm for calculating Code39 barcode length 2025-09-26 10:36:41 -06:00
Linker Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Members Bug 28308: Remove 0 from "days in advance" for "Advance notice" 2026-01-30 10:54:02 -07:00
OAI Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Output Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Patroncards Bug 40680: Fix C4/Patroncards/Patroncard.pm 2025-12-01 08:33:57 -07:00
Reports Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
SIP Bug 41369: SIP payments have no branchcode 2025-12-17 13:24:30 -07:00
Search Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Serials Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Utils/DataTables Bug 41042: default_save_state is enabled by default 2025-10-23 11:33:32 -06:00
Accounts.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Acquisition.pm Bug 39722: (follow-up) Remove find 2026-02-06 15:17:09 -07:00
Auth.pm Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
Auth_cas_servers.yaml.sample Bug 17065 - Rename C4/Auth_cas_servers.yaml.orig 2016-08-08 13:16:36 +00:00
Auth_with_cas.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Auth_with_ldap.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Auth_with_shibboleth.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
AuthoritiesMarc.pm Bug 35423: Fix substr outside of string warning 2026-01-23 07:29:01 -07:00
Barcodes.pm Bug 18584: Remove trailing spaces in Barcodes.pm 2025-11-18 06:56:42 -07:00
Biblio.pm Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
Breeding.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Budgets.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Calendar.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Charset.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Circulation.pm Bug 7376: Transfer limits should be checked at check-in 2026-02-06 15:17:20 -07:00
ClassSortRoutine.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
ClassSource.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
ClassSplitRoutine.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Context.pm Bug 41102: Error 500 on the About page when biblioserver Zebra configuration is missing 2026-01-12 10:25:55 -07:00
Contract.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
CourseReserves.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Creators.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
HTML5Media.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Heading.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
HoldsQueue.pm Bug 41781: Holds queue builder ( build_holds_queue.pl ) fails if HoldsQueueParallelLoopsCount is greater than 1 2026-02-06 07:21:03 -07:00
ImportBatch.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
ImportExportFramework.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
InstallAuth.pm Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
Installer.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ItemCirculationAlertPreference.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Items.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Koha.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Labels.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Languages.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Letters.pm Bug 41684: Make `notices_content` hook be used with `get_enabled_plugins()` 2026-02-06 15:17:16 -07:00
Linker.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Log.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
MarcModificationTemplates.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Matcher.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Members.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Message.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Output.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Overdues.pm Bug 41315: (follow-up) Rename statements for clarity 2026-01-28 14:24:04 -07:00
Patroncards.pm Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
Record.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Reports.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Reserves.pm Bug 41416: Add skip_fix_priority option to ModReserve 2026-01-16 14:07:18 -07:00
Ris.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
RotatingCollections.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
SMS.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Scheduler.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Scrubber.pm Bug 39860: Update scrubber profile and add Scrubber.t test 2025-11-03 14:13:47 -07:00
Search.pm Bug 41287: (QA follow-up) Fix HTML syntax and improve logic consistency 2025-12-29 09:56:09 -07:00
Serials.pm Bug 38061: (QA follow-up) Add default falsy value for subscription creation/editing 2026-01-22 10:02:19 -07:00
Service.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
ShelfBrowser.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
SocialData.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Stats.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Suggestions.pm Bug 39722: Remove GetSuggestionFromBiblionumber from C4/Suggestions.pm 2026-02-06 15:17:09 -07:00
TTParser.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Tags.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
Templates.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
TmplToken.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
TmplTokenType.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
UsageStats.pm Bug 30331: Rename RenewalPeriodBase as ManualRenewalPeriodBase and add AutomaticRenewalPeriodBase sys pref 2026-01-30 10:54:20 -07:00
XISBN.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00
XSLT.pm Bug 40680: Move EXPORT_OK right after Modern::Perl 2025-12-01 08:33:56 -07:00