Bug 17583: Use Koha::Patron->is_expired from the circulation page

Bug 17579 introduces a Koha::Patron->is_expired method.
Let's use it from this script.

Test plan:
Confirm that you see the message on the interface from the circulation
page for an expired patron

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-11-08 12:26:00 +01:00 committed by Kyle M Hall
parent 4716c495e0
commit 57eb834ba7

View file

@ -268,15 +268,8 @@ if ($borrowernumber) {
$borrower = GetMemberDetails( $borrowernumber, 0 ); $borrower = GetMemberDetails( $borrowernumber, 0 );
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber ); my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
# Warningdate is the date that the warning starts appearing
my ( $today_year, $today_month, $today_day) = Today();
my ($warning_year, $warning_month, $warning_day) = split /-/, $borrower->{'dateexpiry'};
my ( $enrol_year, $enrol_month, $enrol_day) = split /-/, $borrower->{'dateenrolled'};
# if the expiry date is before today ie they have expired # if the expiry date is before today ie they have expired
if ( !$borrower->{'dateexpiry'} || $warning_year*$warning_month*$warning_day==0 if ( $patron->is_expired ) {
|| Date_to_Days($today_year, $today_month, $today_day )
> Date_to_Days($warning_year, $warning_month, $warning_day) )
{
#borrowercard expired, no issues #borrowercard expired, no issues
$template->param( $template->param(
noissues => ($force_allow_issue) ? 0 : "1", noissues => ($force_allow_issue) ? 0 : "1",