Lines 832-838
sub CanBookBeIssued {
Link Here
|
832 |
$issuingimpossible{DEBARRED} = 1; |
832 |
$issuingimpossible{DEBARRED} = 1; |
833 |
} |
833 |
} |
834 |
|
834 |
|
835 |
if ( $patron->is_expired ) { |
835 |
if ( $patron->is_expired({ cache => 1 }) ) { |
836 |
$issuingimpossible{EXPIRED} = 1; |
836 |
$issuingimpossible{EXPIRED} = 1; |
837 |
} |
837 |
} |
838 |
|
838 |
|
Lines 918-924
sub CanBookBeIssued {
Link Here
|
918 |
else { |
918 |
else { |
919 |
$issuingimpossible{USERBLOCKEDWITHENDDATE} = $debarred_date; |
919 |
$issuingimpossible{USERBLOCKEDWITHENDDATE} = $debarred_date; |
920 |
} |
920 |
} |
921 |
} elsif ( my $num_overdues = $patron->has_overdues ) { |
921 |
} elsif ( my $num_overdues = $patron->has_overdues({ cache => 1 }) ) { |
922 |
## patron has outstanding overdue loans |
922 |
## patron has outstanding overdue loans |
923 |
if ( C4::Context->preference("OverduesBlockCirc") eq 'block'){ |
923 |
if ( C4::Context->preference("OverduesBlockCirc") eq 'block'){ |
924 |
$issuingimpossible{USERBLOCKEDOVERDUE} = $num_overdues; |
924 |
$issuingimpossible{USERBLOCKEDOVERDUE} = $num_overdues; |
Lines 1716-1722
sub AddIssue {
Link Here
|
1716 |
if ( $accumulate_charge > 0 ) { |
1716 |
if ( $accumulate_charge > 0 ) { |
1717 |
AddIssuingCharge( $issue, $accumulate_charge, 'RENT_DAILY' ); |
1717 |
AddIssuingCharge( $issue, $accumulate_charge, 'RENT_DAILY' ); |
1718 |
$charge += $accumulate_charge; |
1718 |
$charge += $accumulate_charge; |
1719 |
$item_unblessed->{charge} = $charge; |
|
|
1720 |
} |
1719 |
} |
1721 |
} |
1720 |
} |
1722 |
|
1721 |
|
Lines 2522-2528
sub MarkIssueReturned {
Link Here
|
2522 |
# Remove any OVERDUES related debarment if the borrower has no overdues |
2521 |
# Remove any OVERDUES related debarment if the borrower has no overdues |
2523 |
if ( C4::Context->preference('AutoRemoveOverduesRestrictions') |
2522 |
if ( C4::Context->preference('AutoRemoveOverduesRestrictions') |
2524 |
&& $patron->debarred |
2523 |
&& $patron->debarred |
2525 |
&& !$patron->has_overdues |
2524 |
&& !$patron->has_overdues({ cache => 1 }) |
2526 |
&& @{ GetDebarments({ borrowernumber => $borrowernumber, type => 'OVERDUES' }) } |
2525 |
&& @{ GetDebarments({ borrowernumber => $borrowernumber, type => 'OVERDUES' }) } |
2527 |
) { |
2526 |
) { |
2528 |
DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); |
2527 |
DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); |
Lines 2879-2885
sub CanBookBeRenewed {
Link Here
|
2879 |
my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing'); |
2878 |
my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing'); |
2880 |
my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing'); |
2879 |
my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing'); |
2881 |
my $restricted = $patron->is_debarred; |
2880 |
my $restricted = $patron->is_debarred; |
2882 |
my $hasoverdues = $patron->has_overdues; |
2881 |
my $hasoverdues = $patron->has_overdues({ cache => 1 }); |
2883 |
|
2882 |
|
2884 |
if ( $restricted and $restrictionblockrenewing ) { |
2883 |
if ( $restricted and $restrictionblockrenewing ) { |
2885 |
return ( 0, 'restriction'); |
2884 |
return ( 0, 'restriction'); |
Lines 3156-3162
sub AddRenewal {
Link Here
|
3156 |
# Remove any OVERDUES related debarment if the borrower has no overdues |
3155 |
# Remove any OVERDUES related debarment if the borrower has no overdues |
3157 |
if ( $patron |
3156 |
if ( $patron |
3158 |
&& $patron->is_debarred |
3157 |
&& $patron->is_debarred |
3159 |
&& ! $patron->has_overdues |
3158 |
&& ! $patron->has_overdues({ cache => 1 }) |
3160 |
&& @{ GetDebarments({ borrowernumber => $borrowernumber, type => 'OVERDUES' }) } |
3159 |
&& @{ GetDebarments({ borrowernumber => $borrowernumber, type => 'OVERDUES' }) } |
3161 |
) { |
3160 |
) { |
3162 |
DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); |
3161 |
DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); |
Lines 4371-4377
sub _CanBookBeAutoRenewed {
Link Here
|
4371 |
} |
4370 |
} |
4372 |
); |
4371 |
); |
4373 |
|
4372 |
|
4374 |
if ( $patron->is_expired && $patron->category->effective_BlockExpiredPatronOpacActions ) { |
4373 |
if ( $patron->is_expired({ cache => 1 }) && $patron->category->effective_BlockExpiredPatronOpacActions ) { |
4375 |
return 'auto_account_expired'; |
4374 |
return 'auto_account_expired'; |
4376 |
} |
4375 |
} |
4377 |
|
4376 |
|