Lines 801-826
sub CanBookBeIssued {
Link Here
|
801 |
$alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges ); |
801 |
$alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges ); |
802 |
} |
802 |
} |
803 |
|
803 |
|
804 |
my ($blocktype, $count) = C4::Members::IsMemberBlocked($borrower->{'borrowernumber'}); |
804 |
my $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); |
805 |
if ($blocktype == -1) { |
805 |
if ( my $debarred_date = $patron->is_debarred ) { |
806 |
## patron has outstanding overdue loans |
806 |
# patron has accrued fine days or has a restriction. $count is a date |
807 |
if ( C4::Context->preference("OverduesBlockCirc") eq 'block'){ |
807 |
if ($debarred_date eq '9999-12-31') { |
808 |
$issuingimpossible{USERBLOCKEDOVERDUE} = $count; |
808 |
$issuingimpossible{USERBLOCKEDNOENDDATE} = $debarred_date; |
809 |
} |
|
|
810 |
elsif ( C4::Context->preference("OverduesBlockCirc") eq 'confirmation'){ |
811 |
$needsconfirmation{USERBLOCKEDOVERDUE} = $count; |
812 |
} |
813 |
} elsif($blocktype == 1) { |
814 |
# patron has accrued fine days or has a restriction. $count is a date |
815 |
if ($count eq '9999-12-31') { |
816 |
$issuingimpossible{USERBLOCKEDNOENDDATE} = $count; |
817 |
} |
809 |
} |
818 |
else { |
810 |
else { |
819 |
$issuingimpossible{USERBLOCKEDWITHENDDATE} = $count; |
811 |
$issuingimpossible{USERBLOCKEDWITHENDDATE} = $debarred_date; |
|
|
812 |
} |
813 |
} elsif ( my $num_overdues = $patron->has_overdues ) { |
814 |
## patron has outstanding overdue loans |
815 |
if ( C4::Context->preference("OverduesBlockCirc") eq 'block'){ |
816 |
$issuingimpossible{USERBLOCKEDOVERDUE} = $num_overdues; |
817 |
} |
818 |
elsif ( C4::Context->preference("OverduesBlockCirc") eq 'confirmation'){ |
819 |
$needsconfirmation{USERBLOCKEDOVERDUE} = $num_overdues; |
820 |
} |
820 |
} |
821 |
} |
821 |
} |
822 |
|
822 |
|
823 |
# |
|
|
824 |
# JB34 CHECKS IF BORROWERS DON'T HAVE ISSUE TOO MANY BOOKS |
823 |
# JB34 CHECKS IF BORROWERS DON'T HAVE ISSUE TOO MANY BOOKS |
825 |
# |
824 |
# |
826 |
my $switch_onsite_checkout = |
825 |
my $switch_onsite_checkout = |
Lines 848-854
sub CanBookBeIssued {
Link Here
|
848 |
# |
847 |
# |
849 |
# CHECKPREVCHECKOUT: CHECK IF ITEM HAS EVER BEEN LENT TO PATRON |
848 |
# CHECKPREVCHECKOUT: CHECK IF ITEM HAS EVER BEEN LENT TO PATRON |
850 |
# |
849 |
# |
851 |
my $patron = Koha::Patrons->find($borrower->{borrowernumber}); |
850 |
$patron = Koha::Patrons->find($borrower->{borrowernumber}); |
852 |
my $wants_check = $patron->wants_check_for_previous_checkout; |
851 |
my $wants_check = $patron->wants_check_for_previous_checkout; |
853 |
$needsconfirmation{PREVISSUE} = 1 |
852 |
$needsconfirmation{PREVISSUE} = 1 |
854 |
if ($wants_check and $patron->do_check_for_previous_checkout($item)); |
853 |
if ($wants_check and $patron->do_check_for_previous_checkout($item)); |