Lines 77-83
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preferen
Link Here
|
77 |
my $issues = GetPendingIssues($member); # FIXME: wasteful call when really, we only want the count |
77 |
my $issues = GetPendingIssues($member); # FIXME: wasteful call when really, we only want the count |
78 |
my $countissues = scalar(@$issues); |
78 |
my $countissues = scalar(@$issues); |
79 |
|
79 |
|
80 |
my $flags = C4::Members::patronflags( $patron->unblessed ); |
80 |
my $patron = Koha::Patrons->find( $member ); |
|
|
81 |
my $charges = $patron->account->non_issues_charges; |
81 |
my $userenv = C4::Context->userenv; |
82 |
my $userenv = C4::Context->userenv; |
82 |
|
83 |
|
83 |
|
84 |
|
Lines 107-113
if (C4::Context->preference("IndependentBranches")) {
Link Here
|
107 |
my $op = $input->param('op') || 'delete_confirm'; |
108 |
my $op = $input->param('op') || 'delete_confirm'; |
108 |
my $dbh = C4::Context->dbh; |
109 |
my $dbh = C4::Context->dbh; |
109 |
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member); |
110 |
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member); |
110 |
if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_guarantor or $deletelocal == 0) { |
111 |
if ( $op eq 'delete_confirm' or $countissues > 0 or $charges or $is_guarantor or $deletelocal == 0) { |
111 |
$template->param( picture => 1 ) if $patron->image; |
112 |
$template->param( picture => 1 ) if $patron->image; |
112 |
|
113 |
|
113 |
$template->param( adultborrower => 1 ) if $patron->category->category_type =~ /^(A|I)$/; |
114 |
$template->param( adultborrower => 1 ) if $patron->category->category_type =~ /^(A|I)$/; |
Lines 134-141
if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_
Link Here
|
134 |
if ($countissues >0) { |
135 |
if ($countissues >0) { |
135 |
$template->param(ItemsOnIssues => $countissues); |
136 |
$template->param(ItemsOnIssues => $countissues); |
136 |
} |
137 |
} |
137 |
if ($flags->{'CHARGES'} ne '') { |
138 |
if ( $charges > 0 ) { |
138 |
$template->param(charges => $flags->{'CHARGES'}->{'amount'}); |
139 |
$template->param(charges => $charges); |
139 |
} |
140 |
} |
140 |
if ($is_guarantor) { |
141 |
if ($is_guarantor) { |
141 |
$template->param(guarantees => 1); |
142 |
$template->param(guarantees => 1); |
Lines 144-150
if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_
Link Here
|
144 |
$template->param(keeplocal => 1); |
145 |
$template->param(keeplocal => 1); |
145 |
} |
146 |
} |
146 |
# This is silly written but reflect the same conditions as above |
147 |
# This is silly written but reflect the same conditions as above |
147 |
if ( not $countissues > 0 and not $flags->{CHARGES} ne '' and not $is_guarantor and not $deletelocal == 0 ) { |
148 |
if ( not $countissues > 0 and not $charges and not $is_guarantor and not $deletelocal == 0 ) { |
148 |
$template->param( |
149 |
$template->param( |
149 |
op => 'delete_confirm', |
150 |
op => 'delete_confirm', |
150 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
151 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |