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>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Jacob O'Mara 2026-01-21 15:36:16 +00:00 committed by Pedro Amorim
parent 2b210d6da8
commit fa8a860a49
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 15 additions and 0 deletions

View File

@ -114,6 +114,21 @@ $template->param(
guarantor_relationships => $guarantor_relationships,
guarantees => \@guarantees,
);
# Get linked accounts if feature is enabled
my @linked_accounts;
my $linked_accounts_debt = 0;
if ( C4::Context->preference('EnablePatronAccountLinking') ) {
@linked_accounts = $patron->linked_accounts->as_list;
if (@linked_accounts) {
$linked_accounts_debt = $patron->linked_accounts_debt;
}
}
$template->param(
linked_accounts => \@linked_accounts,
linked_accounts_debt => $linked_accounts_debt,
);
if ( C4::Context->preference('ChildNeedsGuarantor')
and ( $patron->is_child or $category->can_be_guarantee )
and $patron->contactname eq ""