From 5a6885ca973f3f43d25bd1e520ff365a0ab23c9e Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Thu, 19 Feb 2026 14:00:42 +0000 Subject: [PATCH] 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 Signed-off-by: Kellie Stephens --- circ/circulation.pl | 12 ++++++++++++ .../prog/en/includes/patron_messages.inc | 11 ++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 1bdd47321a..0d13a4f326 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -695,6 +695,18 @@ if ($patron) { } } + # Check the debt of this patron's linked accounts + my $no_issues_charge_linked = $patron_charge_limits->{NoIssuesChargeLinkedAccounts}->{limit}; + if ( defined $no_issues_charge_linked ) { + if ( $patron_charge_limits->{NoIssuesChargeLinkedAccounts}->{overlimit} ) { + $template->param( + charges_linked_accounts => 1, + chargesamount_linked_accounts => $patron_charge_limits->{NoIssuesChargeLinkedAccounts}->{charge}, + ); + $noissues = 1 unless C4::Context->preference("allowfineoverride"); + } + } + if ( $patron->has_overdues ) { $template->param( odues => 1 ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc index dbabcef9aa..2936efabf5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -5,7 +5,7 @@ [% SET return_claims = patron.return_claims %] [% SET logged_in_branchcode = Branches.GetLoggedInBranchcode() %] -[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || limited_category || charges || charges_guarantors_guarantees || charges_guarantees || credits || patron.account_locked ) %] +[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || limited_category || charges || charges_guarantors_guarantees || charges_guarantees || charges_linked_accounts || credits || patron.account_locked ) %]

Attention

    [% IF ( has_modifications ) %] @@ -166,6 +166,15 @@ [% END %] + [% IF ( charges_linked_accounts ) %] +
  • + Charges: Patron's linked accounts collectively owe [% chargesamount_linked_accounts | $Price %]. + [% IF noissues %] + Checkouts are BLOCKED because fine balance is OVER THE LIMIT. + [% END %] +
  • + [% END %] + [% IF ( credits ) %]
  • Credits: Patron has outstanding credits [% IF ( creditsamount ) %]of [% creditsamount | $Price %][% END %]
  • [% END %] -- 2.39.5