From Nick via Bug 39644: I think there is more cleanup to be done here. relationships_debt is only called twice in the code base: once in moremember.pl once in Koha::Patron->is_patron_inside_charge_limits (which is also called in moremember) The two calls are: - moremember: $patron->relationships_debt( { include_guarantors => 0, only_this_guarantor => 1, include_this_patron => 1 } ); - is_patron_inside_charge_limits: $patron->relationships_debt( { include_guarantors => 1, only_this_guarantor => 0, include_this_patron => 1 } ); The difference being that the first returns only the single patrons fine + their guarantees, the latter returns the patron and thier gusarantees and the guarantees other guarantors The first being a subset of the second, we should be able to return this additional info from "is_patron_inside_charge_limits" and avoid a double call. Additionally, moremember does checks against "NoIssuesChargeGuarantorsWithGuarantees" and "NoIssuesChargeGuarantees" - both of which are checked inside "is_patron_inside_charge_limits" so we can simply use values we are already calculating and not calculate them again