|
Lines 67-79
sub new {
Link Here
|
| 67 |
my $debarred = $patron->is_debarred; |
67 |
my $debarred = $patron->is_debarred; |
| 68 |
siplog( "LOG_DEBUG", "Debarred = %s : ", ( $debarred || 'undef' ) ); # Do we need more debug info here? |
68 |
siplog( "LOG_DEBUG", "Debarred = %s : ", ( $debarred || 'undef' ) ); # Do we need more debug info here? |
| 69 |
my $expired = 0; |
69 |
my $expired = 0; |
| 70 |
if ( $kp->{'dateexpiry'} && C4::Context->preference('NotifyBorrowerDeparture') ) { |
70 |
if ( $kp->{'dateexpiry'} ) { |
| 71 |
my ( $today_year, $today_month, $today_day ) = Today(); |
71 |
my ( $today_year, $today_month, $today_day ) = Today(); |
| 72 |
my ( $warning_year, $warning_month, $warning_day ) = split /-/, $kp->{'dateexpiry'}; |
72 |
my ( $warning_year, $warning_month, $warning_day ) = split /-/, $kp->{'dateexpiry'}; |
| 73 |
my $days_to_expiry = Date_to_Days( $warning_year, $warning_month, $warning_day ) - |
73 |
my $days_to_expiry = Date_to_Days( $warning_year, $warning_month, $warning_day ) - |
| 74 |
Date_to_Days( $today_year, $today_month, $today_day ); |
74 |
Date_to_Days( $today_year, $today_month, $today_day ); |
| 75 |
my $dt = dt_from_string( $kp->{'dateexpiry'}, 'iso' ); |
75 |
my $dt = dt_from_string( $kp->{'dateexpiry'}, 'iso' ); |
| 76 |
my $dateexpiry = output_pref( { dt => $dt, dateonly => 1 } ); |
76 |
my $dateexpiry = output_pref( { dt => $dt, dateonly => 1 } ); |
|
|
77 |
my $notifyBorrowerDeparture = C4::Context->preference('NotifyBorrowerDeparture') // 0; |
| 77 |
if ( $days_to_expiry < 0 ) { |
78 |
if ( $days_to_expiry < 0 ) { |
| 78 |
|
79 |
|
| 79 |
#borrower card has expired, warn the borrower |
80 |
#borrower card has expired, warn the borrower |
|
Lines 82-88
sub new {
Link Here
|
| 82 |
} |
83 |
} |
| 83 |
$kp->{opacnote} .= "Your account has expired as of $dateexpiry"; |
84 |
$kp->{opacnote} .= "Your account has expired as of $dateexpiry"; |
| 84 |
$expired = 1; |
85 |
$expired = 1; |
| 85 |
} elsif ( $days_to_expiry < C4::Context->preference('NotifyBorrowerDeparture') ) { |
86 |
} elsif ( $days_to_expiry < $notifyBorrowerDeparture ) { |
| 86 |
|
87 |
|
| 87 |
# borrower card soon to expire, warn the borrower |
88 |
# borrower card soon to expire, warn the borrower |
| 88 |
if ( $kp->{opacnote} ) { |
89 |
if ( $kp->{opacnote} ) { |
|
Lines 794-797
__END__
Link Here
|
| 794 |
{itemlist} ref-to-array: list of available items |
795 |
{itemlist} ref-to-array: list of available items |
| 795 |
|
796 |
|
| 796 |
=cut |
797 |
=cut |
| 797 |
|
|
|