Lines 190-195
my @overdues;
Link Here
|
190 |
my @issuedat; |
190 |
my @issuedat; |
191 |
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; |
191 |
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; |
192 |
my $pending_checkouts = $patron->pending_checkouts->search({}, { order_by => [ { -desc => 'date_due' }, { -asc => 'issue_id' } ] }); |
192 |
my $pending_checkouts = $patron->pending_checkouts->search({}, { order_by => [ { -desc => 'date_due' }, { -asc => 'issue_id' } ] }); |
|
|
193 |
my $are_renewable_items = 0; |
193 |
if ( $pending_checkouts->count ) { # Useless test |
194 |
if ( $pending_checkouts->count ) { # Useless test |
194 |
while ( my $c = $pending_checkouts->next ) { |
195 |
while ( my $c = $pending_checkouts->next ) { |
195 |
my $issue = $c->unblessed_all_relateds; |
196 |
my $issue = $c->unblessed_all_relateds; |
Lines 226-231
if ( $pending_checkouts->count ) { # Useless test
Link Here
|
226 |
( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber ); |
227 |
( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber ); |
227 |
$issue->{itemtype_object} = Koha::ItemTypes->find( Koha::Items->find( $issue->{itemnumber} )->effective_itemtype ); |
228 |
$issue->{itemtype_object} = Koha::ItemTypes->find( Koha::Items->find( $issue->{itemnumber} )->effective_itemtype ); |
228 |
if($status && C4::Context->preference("OpacRenewalAllowed")){ |
229 |
if($status && C4::Context->preference("OpacRenewalAllowed")){ |
|
|
230 |
$are_renewable_items = 1; |
229 |
$issue->{'status'} = $status; |
231 |
$issue->{'status'} = $status; |
230 |
} |
232 |
} |
231 |
|
233 |
|
Lines 299-305
if ( $pending_checkouts->count ) { # Useless test
Link Here
|
299 |
} |
301 |
} |
300 |
} |
302 |
} |
301 |
my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing'); |
303 |
my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing'); |
302 |
$canrenew = 0 if ($overduesblockrenewing ne 'allow' and $overdues_count == $count); |
304 |
$canrenew = 0 if ($overduesblockrenewing ne 'allow' and $overdues_count == $count) || !$are_renewable_items; |
303 |
|
305 |
|
304 |
$template->param( ISSUES => \@issuedat ); |
306 |
$template->param( ISSUES => \@issuedat ); |
305 |
$template->param( issues_count => $count ); |
307 |
$template->param( issues_count => $count ); |
306 |
- |
|
|