[% IF ( patronupdate ) %]<div class="dialog message"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
+ [% IF ( BORROWER_INF.warndeparture ) %]
+ <div class="dialog alert">
+ <strong>Please note:</strong><span> Your card will expire on [% BORROWER_INF.warndeparture %]. Please contact the library if you wish to renew your subscription.</span>
+ [% IF ( BORROWER_INF.returnbeforeexpiry ) %]<span> Also note that you must return all checked out items before your card expires.</span>[% END %]
+ </div>
+ [% END %]
[% IF ( BORROWER_INF.flagged ) %]
<div class="dialog alert">
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
+use Date::Calc qw(
+ Today
+ Add_Delta_Days
+ Date_to_Days
+);
+
my $query = new CGI;
BEGIN {
# get borrower information ....
my ( $borr ) = GetMemberDetails( $borrowernumber );
+my ( $today_year, $today_month, $today_day) = Today();
+my ($warning_year, $warning_month, $warning_day) = split /-/, $borr->{'dateexpiry'};
+
for (qw(dateenrolled dateexpiry dateofbirth)) {
($borr->{$_}) and $borr->{$_} = format_date($borr->{$_});
}
my @bordat;
$bordat[0] = $borr;
+# Warningdate is the date that the warning starts appearing
+if ( C4::Context->preference('NotifyBorrowerDeparture') &&
+ Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
+ Date_to_Days( $today_year, $today_month, $today_day ) )
+{
+ # borrower card soon to expire, warn the borrower
+ $borr->{'warndeparture'} = $borr->{dateexpiry};
+ if (C4::Context->preference('ReturnBeforeExpiry')){
+ $borr->{'returnbeforeexpiry'} = 1;
+ }
+}
+
$template->param( BORROWER_INFO => \@bordat,
borrowernumber => $borrowernumber,
patron_flagged => $borr->{flagged},