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 4f2dc41e24..507c3fd0f0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc
@@ -76,7 +76,7 @@
[% END %]
View restrictions
- [% IF (noissues && CAN_user_circulate_force_checkout) %]
+ [% IF (noissues && CAN_user_circulate_force_checkout && !moremember) %]
Override restriction temporarily
diff --git a/members/moremember.pl b/members/moremember.pl
index 6d5b3b2e03..5813c8d87f 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -251,6 +251,19 @@ if( ( my $owing = $account->non_issues_charges ) > 0 ) {
);
}
+# Check the debt of this patrons guarantors *and* the guarantees of those guarantors
+my $no_issues_charge_guarantors = C4::Context->preference("NoIssuesChargeGuarantorsWithGuarantees");
+if ( $no_issues_charge_guarantors ) {
+ my $guarantors_non_issues_charges = $patron->relationships_debt({ include_guarantors => 1, only_this_guarantor => 0, include_this_patron => 1 });
+
+ if ( $guarantors_non_issues_charges > $no_issues_charge_guarantors ) {
+ $template->param(
+ noissues => 1,
+ charges_guarantors_guarantees => $guarantors_non_issues_charges
+ );
+ }
+}
+
# if the expiry date is before today ie they have expired
if ( $patron->is_expired ) {
#borrowercard expired, no issues