In a Koha system containing multiple functionally-autonomous libraries, one patron may have multiple distinct accounts within the same Koha system. These accounts represent distinct cards from distinct libraries and need their circulation rules enforced as such, so they can't be merged into one account. But no one of these accounts is "primary" and they all represent the same person, so guarantor/guarantee relationships are a poor conceptual fit (and may already be in use for their intended purpose). These linked/shared accounts would: - clearly link between each other in the Details of the patron record - optionally reciprocally enforce restrictions and blocks due to fines & fees (when one account is blocked, all are) - optionally allow checkout of on-hold items for shared accounts For that last item, assuming one patron has accounts card1 and card2. They have a hold ready for pickup on their card1 account. If Koha attempts to check the waiting item out to the card2 account, koha should check the item out on the card1 account, mark the hold complete, and give the user a clear on-screen message as to what happened. It should not ask for confirmation.
Library patrons may qualify for different levels of library service in multiple library services areas. For example, one might live in one town, own a vacation property elsewhere, and work yet somewhere else. Each of those libraries have certain materials/services that they only allow local card-holders to access, thus why some people receive multiple cards. This is more prevalent in some cooperatives/consortia representing many tax districts, municipalities, and counties via a single instance of the ILS. The guarantee/guarantor function is great for family dynamics, but does not work for individuals who possess two, three, or more total library cards (each at different libraries). Choosing which library card in these situations should be the guarantor is awkward at best and politically charged at worst. We also don't want a situation where a patron tries to game the system by running up huge bills on each account without an auto-block coming into play. Having the ability to simply connect multiple patron accounts together to better manage that person's library privileges, usage, and restrictions is vital to keeping a harmonious relationship between libraries. This change would not remove or force any Koha libraries to abandon the guarantee/guarantor functionality. We just need to add another option.
Created attachment 193344 [details] [review] Bug 39658: DB: Add patron_account_links table and sysprefs Patron Account Linking: Test Plan Setup: Enable all 3 sysprefs: EnablePatronAccountLinking = Enable, NoIssuesChargeLinkedAccounts = 10, AllowLinkedAccountHoldPickup = Allow. Linking: 1. Go to Koha's detail page (moremember.pl). Confirm the "Linked accounts" section appears. 2. Click "Add linked account", search for Henry, link him. Confirm Henry appears in the list. 3. Repeat to link Edna. Confirm both Henry and Edna are listed under Koha. 4. Go to Henry's detail page. Confirm Koha and Edna appear as linked accounts. 5. Test "Leave linked group" on Edna — confirm she is removed from all linked accounts. Checkout blocking (NoIssuesChargeLinkedAccounts): 6. Re-link Edna to the group. 7. Add fines across Koha, Henry, and Edna so the combined total exceeds 10. 8. Try checking out an item to any of them — confirm the linked account debt warning/block appears. 9. Reduce fines below 10 — confirm checkout proceeds without warning. Hold pickup (AllowLinkedAccountHoldPickup): 10. Place a hold for Koha on an available item. Check it in so it's waiting. 11. Check out that waiting item to Henry — confirm it succeeds and is issued to Koha automatically. 12. Disable AllowLinkedAccountHoldPickup. Repeat — confirm the redirect does not occur. Adds table and 3 sysprefs for patron account linking feature.
Created attachment 193345 [details] [review] Bug 39658: Add Koha::Patron::AccountLink(s) objects New objects to manage patron account links.
Created attachment 193346 [details] [review] Bug 39658: Add linked account methods to Koha::Patron Methods: account_link, linked_accounts, all_linked_borrowernumbers, linked_accounts_debt. Also adds charge limit checking.
Created attachment 193347 [details] [review] Bug 39658: API: Add REST endpoints for patron account links Endpoints: GET/POST/DELETE /patrons/{id}/account_links
Created attachment 193348 [details] [review] Bug 39658: Circulation: Add linked account fee/hold checks DEBT_LINKED_ACCOUNTS blocker and LINKED_ACCOUNT_HOLD_PICKUP alert.
Created attachment 193349 [details] [review] Bug 39658: Circulation: Add linked account hold pickup redirect Enable linked patrons to pick up each other's holds when allowed.
Created attachment 193350 [details] [review] Bug 39658: Circulation UI: Add linked account fee/hold messages Display warnings for combined debt and linked hold pickup.
Created attachment 193351 [details] [review] Bug 39658: Patron detail: Pass linked accounts to template Add linked_accounts and link_group data for display.
Created attachment 193352 [details] [review] Bug 39658: Patron detail UI: Add linked accounts section Display linked patrons with Add/Leave link group buttons.
Created attachment 193353 [details] [review] Bug 39658: Admin: Add linked account system preferences UI Add prefs for EnablePatronAccountLinking and related settings.
Created attachment 193354 [details] [review] Bug 39658: Tests: Add unit tests for Koha::Patron::AccountLink Test linking, group management, and linked_accounts methods.
Created attachment 193355 [details] [review] Bug 39658: Tests: Add API tests for patron account links endpoints Test GET/POST/DELETE /api/v1/patrons/{id}/account_links.
Created attachment 193356 [details] [review] Bug 39658: Add Koha::Exceptions::PatronAccountLink Add typed exceptions for patron account linking: - AlreadyLinked: patrons already in same group - DifferentGroups: patrons in different groups
Created attachment 193357 [details] [review] Bug 39658: Add link_to_patron and linked_account_links methods - link_to_patron($other_patron): Links patrons, handles group logic - linked_account_links(): Returns all links in patron's group
Created attachment 193358 [details] [review] Bug 39658: DBIC schema - DO NOT PUSH Auto-generated schema for patron_account_links table.
Created attachment 193359 [details] [review] Bug 39658: Schema: Add Koha object class mappings Map PatronAccountLink to Koha::Patron::AccountLink(s).
Created attachment 193462 [details] [review] Bug 39658: DB: Add patron_account_links table and sysprefs Adds table and 3 sysprefs for patron account linking feature. Setup: Enable all 3 sysprefs: EnablePatronAccountLinking = Enable, NoIssuesChargeLinkedAccounts = 10, AllowLinkedAccountHoldPickup = Allow. Linking: 1. Go to Koha's detail page (moremember.pl). Confirm the "Linked accounts" section appears. 2. Click "Add linked account", search for Henry, link him. Confirm Henry appears in the list. 3. Repeat to link Edna. Confirm both Henry and Edna are listed under Koha. 4. Go to Henry's detail page. Confirm Koha and Edna appear as linked accounts. 5. Test "Leave linked group" on Edna — confirm she is removed from all linked accounts. Checkout blocking (NoIssuesChargeLinkedAccounts): 6. Re-link Edna to the group. 7. Add fines across Koha, Henry, and Edna so the combined total exceeds 10. 8. Try checking out an item to any of them — confirm the linked account debt warning/block appears. 9. Reduce fines below 10 — confirm checkout proceeds without warning. Hold pickup (AllowLinkedAccountHoldPickup): 10. Place a hold for Koha on an available item. Check it in so it's waiting. 11. Check out that waiting item to Henry — confirm it succeeds and is issued to Koha automatically. 12. Disable AllowLinkedAccountHoldPickup. Repeat — confirm the redirect does not occur.
Created attachment 193463 [details] [review] Bug 39658: Add Koha::Patron::AccountLink(s) objects New objects to manage patron account links.
Created attachment 193464 [details] [review] Bug 39658: Add linked account methods to Koha::Patron Methods: account_link, linked_accounts, all_linked_borrowernumbers, linked_accounts_debt. Also adds charge limit checking.
Created attachment 193465 [details] [review] Bug 39658: API: Add REST endpoints for patron account links Endpoints: GET/POST/DELETE /patrons/{id}/account_links
Created attachment 193466 [details] [review] Bug 39658: Circulation: Add linked account fee/hold checks DEBT_LINKED_ACCOUNTS blocker and LINKED_ACCOUNT_HOLD_PICKUP alert.
Created attachment 193467 [details] [review] Bug 39658: Circulation: Add linked account hold pickup redirect Enable linked patrons to pick up each other's holds when allowed.
Created attachment 193468 [details] [review] Bug 39658: Circulation UI: Add linked account fee/hold messages Display warnings for combined debt and linked hold pickup.
Created attachment 193469 [details] [review] Bug 39658: Patron detail: Pass linked accounts to template Add linked_accounts and link_group data for display.
Created attachment 193470 [details] [review] Bug 39658: Patron detail UI: Add linked accounts section Display linked patrons with Add/Leave link group buttons.
Created attachment 193471 [details] [review] Bug 39658: Admin: Add linked account system preferences UI Add prefs for EnablePatronAccountLinking and related settings.
Created attachment 193472 [details] [review] Bug 39658: Tests: Add unit tests for Koha::Patron::AccountLink Test linking, group management, and linked_accounts methods.
Created attachment 193473 [details] [review] Bug 39658: Tests: Add API tests for patron account links endpoints Test GET/POST/DELETE /api/v1/patrons/{id}/account_links.
Created attachment 193474 [details] [review] Bug 39658: Add Koha::Exceptions::PatronAccountLink Add typed exceptions for patron account linking: - AlreadyLinked: patrons already in same group - DifferentGroups: patrons in different groups
Created attachment 193475 [details] [review] Bug 39658: Add link_to_patron and linked_account_links methods - link_to_patron($other_patron): Links patrons, handles group logic - linked_account_links(): Returns all links in patron's group
Created attachment 193476 [details] [review] Bug 39658: DBIC schema - DO NOT PUSH Auto-generated schema for patron_account_links table.
Created attachment 193477 [details] [review] Bug 39658: Schema: Add Koha object class mappings Map PatronAccountLink to Koha::Patron::AccountLink(s).
Created attachment 193478 [details] [review] Bug 39658: (follow-up) linked hold pickup all types Linked account hold pickup check now applies to all hold statuses (Reserved, Transferred, Processing), not just Waiting.
Created attachment 193479 [details] [review] Bug 39658: (follow-up) block checkout when linked accounts over charge limit When AllowFineOverride is disabled and NoIssuesChargeLinkedAccounts is exceeded, hide the barcode field and show 'Cannot check out'.
Created attachment 193781 [details] [review] Bug 39658: DB: Add patron_account_links table and sysprefs Adds table and 3 sysprefs for patron account linking feature. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193782 [details] [review] Bug 39658: Add Koha::Patron::AccountLink(s) objects New objects to manage patron account links. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193783 [details] [review] Bug 39658: Add linked account methods to Koha::Patron Methods: account_link, linked_accounts, all_linked_borrowernumbers, linked_accounts_debt. Also adds charge limit checking. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193784 [details] [review] Bug 39658: API: Add REST endpoints for patron account links Endpoints: GET/POST/DELETE /patrons/{id}/account_links Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193785 [details] [review] Bug 39658: Circulation: Add linked account fee/hold checks DEBT_LINKED_ACCOUNTS blocker and LINKED_ACCOUNT_HOLD_PICKUP alert. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193786 [details] [review] Bug 39658: Circulation: Add linked account hold pickup redirect Enable linked patrons to pick up each other's holds when allowed. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193787 [details] [review] Bug 39658: Circulation UI: Add linked account fee/hold messages Display warnings for combined debt and linked hold pickup. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193788 [details] [review] Bug 39658: Patron detail: Pass linked accounts to template Add linked_accounts and link_group data for display. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193789 [details] [review] Bug 39658: Patron detail UI: Add linked accounts section Display linked patrons with Add/Leave link group buttons. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193790 [details] [review] Bug 39658: Admin: Add linked account system preferences UI Add prefs for EnablePatronAccountLinking and related settings. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193791 [details] [review] Bug 39658: Tests: Add unit tests for Koha::Patron::AccountLink Test linking, group management, and linked_accounts methods. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193792 [details] [review] Bug 39658: Tests: Add API tests for patron account links endpoints Test GET/POST/DELETE /api/v1/patrons/{id}/account_links. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193793 [details] [review] Bug 39658: Add Koha::Exceptions::PatronAccountLink Add typed exceptions for patron account linking: - AlreadyLinked: patrons already in same group - DifferentGroups: patrons in different groups Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193794 [details] [review] Bug 39658: Add link_to_patron and linked_account_links methods - link_to_patron($other_patron): Links patrons, handles group logic - linked_account_links(): Returns all links in patron's group Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193795 [details] [review] Bug 39658: DBIC schema - DO NOT PUSH Auto-generated schema for patron_account_links table. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193796 [details] [review] Bug 39658: Schema: Add Koha object class mappings Map PatronAccountLink to Koha::Patron::AccountLink(s). Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193797 [details] [review] Bug 39658: (follow-up) linked hold pickup all types Linked account hold pickup check now applies to all hold statuses (Reserved, Transferred, Processing), not just Waiting. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193798 [details] [review] Bug 39658: (follow-up) block checkout when linked accounts over charge limit When AllowFineOverride is disabled and NoIssuesChargeLinkedAccounts is exceeded, hide the barcode field and show 'Cannot check out'. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Created attachment 193800 [details] [review] Bug 39658: DB: Add patron_account_links table and sysprefs Adds table and 3 sysprefs for patron account linking feature. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193801 [details] [review] Bug 39658: Add Koha::Patron::AccountLink(s) objects New objects to manage patron account links. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193802 [details] [review] Bug 39658: Add linked account methods to Koha::Patron Methods: account_link, linked_accounts, all_linked_borrowernumbers, linked_accounts_debt. Also adds charge limit checking. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193803 [details] [review] Bug 39658: API: Add REST endpoints for patron account links Endpoints: GET/POST/DELETE /patrons/{id}/account_links Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193804 [details] [review] Bug 39658: Circulation: Add linked account fee/hold checks DEBT_LINKED_ACCOUNTS blocker and LINKED_ACCOUNT_HOLD_PICKUP alert. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193805 [details] [review] Bug 39658: Circulation: Add linked account hold pickup redirect Enable linked patrons to pick up each other's holds when allowed. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193806 [details] [review] Bug 39658: Circulation UI: Add linked account fee/hold messages Display warnings for combined debt and linked hold pickup. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193807 [details] [review] Bug 39658: Patron detail: Pass linked accounts to template Add linked_accounts and link_group data for display. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193808 [details] [review] Bug 39658: Patron detail UI: Add linked accounts section Display linked patrons with Add/Leave link group buttons. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193809 [details] [review] Bug 39658: Admin: Add linked account system preferences UI Add prefs for EnablePatronAccountLinking and related settings. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193810 [details] [review] Bug 39658: Tests: Add unit tests for Koha::Patron::AccountLink Test linking, group management, and linked_accounts methods. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193811 [details] [review] Bug 39658: Tests: Add API tests for patron account links endpoints Test GET/POST/DELETE /api/v1/patrons/{id}/account_links. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193812 [details] [review] Bug 39658: Add Koha::Exceptions::PatronAccountLink Add typed exceptions for patron account linking: - AlreadyLinked: patrons already in same group - DifferentGroups: patrons in different groups Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193813 [details] [review] Bug 39658: Add link_to_patron and linked_account_links methods - link_to_patron($other_patron): Links patrons, handles group logic - linked_account_links(): Returns all links in patron's group Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193814 [details] [review] Bug 39658: DBIC schema - DO NOT PUSH Auto-generated schema for patron_account_links table. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193815 [details] [review] Bug 39658: Schema: Add Koha object class mappings Map PatronAccountLink to Koha::Patron::AccountLink(s). Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193816 [details] [review] Bug 39658: (follow-up) linked hold pickup all types Linked account hold pickup check now applies to all hold statuses (Reserved, Transferred, Processing), not just Waiting. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>
Created attachment 193817 [details] [review] Bug 39658: (follow-up) block checkout when linked accounts over charge limit When AllowFineOverride is disabled and NoIssuesChargeLinkedAccounts is exceeded, hide the barcode field and show 'Cannot check out'. Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com>