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->{$_});
}
}
$borr->{'amountoutstanding'} = sprintf "%.02f", $borr->{'amountoutstanding'};
+$borr->{'debarred'} = C4::Dates->new($borr->{'debarred'},'iso')->output;
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},
OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0,
+ surname => $borr->{surname},
+ showname => $borr->{showname},
);
#get issued items ....
if ($issues){
foreach my $issue ( sort { $b->{'date_due'} cmp $a->{'date_due'} } @$issues ) {
# check for reserves
- my ( $restype, $res ) = CheckReserves( $issue->{'itemnumber'} );
+ my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} );
if ( $restype ) {
$issue->{'reserved'} = 1;
}