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 115-122
if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_
Link Here
|
115 |
if ($countissues >0) { |
116 |
if ($countissues >0) { |
116 |
$template->param(ItemsOnIssues => $countissues); |
117 |
$template->param(ItemsOnIssues => $countissues); |
117 |
} |
118 |
} |
118 |
if ($flags->{'CHARGES'} ne '') { |
119 |
if ( $charges > 0 ) { |
119 |
$template->param(charges => $flags->{'CHARGES'}->{'amount'}); |
120 |
$template->param(charges => $charges); |
120 |
} |
121 |
} |
121 |
if ($is_guarantor) { |
122 |
if ($is_guarantor) { |
122 |
$template->param(guarantees => 1); |
123 |
$template->param(guarantees => 1); |
Lines 125-131
if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_
Link Here
|
125 |
$template->param(keeplocal => 1); |
126 |
$template->param(keeplocal => 1); |
126 |
} |
127 |
} |
127 |
# This is silly written but reflect the same conditions as above |
128 |
# This is silly written but reflect the same conditions as above |
128 |
if ( not $countissues > 0 and not $flags->{CHARGES} ne '' and not $is_guarantor and not $deletelocal == 0 ) { |
129 |
if ( not $countissues > 0 and not $charges and not $is_guarantor and not $deletelocal == 0 ) { |
129 |
$template->param( |
130 |
$template->param( |
130 |
op => 'delete_confirm', |
131 |
op => 'delete_confirm', |
131 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |
132 |
csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), |