From 19de20e72c645e3530a721fb0f70c07ade0453da Mon Sep 17 00:00:00 2001
From: Galen Charlton <gmc@esilibrary.com>
Date: Mon, 26 May 2014 03:09:18 +0000
Subject: [PATCH] [COUNTER-PATCH] Bug 12132: display guarantees if a patron
 has them, regardless of category type

If a patron has guarantees, always display them on the patron summary,
even if the patron is of a type that ordinarily would have them.

For example, at present you can cannot directly add a guarantee to
a staff record the way you can do for an adult patron, but if you create
a juvenile patron and add a guarantor to it, you can override that
restriction.  Note that this patch ignores whether that is strictly
desirable behavior.

To test:

[1] Create a juvenile patron.  While editing it, make a staff
    account a guarantor of the new patron.
[2] View patron details for the staff account.  Note that the
    juvenile patron is not displayed as a guarantee.
[3] Apply this patch.
[4] Refresh details for the staff account.  The juvenile should
    now show up.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
---
 members/moremember.pl |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/members/moremember.pl b/members/moremember.pl
index 4f77854..90277e4 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -171,14 +171,14 @@ if ( $category_type eq 'C') {
 if ( $data->{'ethnicity'} || $data->{'ethnotes'} ) {
     $template->param( printethnicityline => 1 );
 }
-if ( $category_type eq 'A' || $category_type eq 'I') {
+my ( $count, $guarantees ) = GetGuarantees( $data->{'borrowernumber'} );
+if ( $count ) {
     $template->param( isguarantee => 1 );
 
     # FIXME
     # It looks like the $i is only being returned to handle walking through
     # the array, which is probably better done as a foreach loop.
     #
-    my ( $count, $guarantees ) = GetGuarantees( $data->{'borrowernumber'} );
     my @guaranteedata;
     for ( my $i = 0 ; $i < $count ; $i++ ) {
         push(@guaranteedata,
-- 
1.7.10.4