From c4d4b6ecf28bf3c7177bb202d27ed136c6f88fca Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Mon, 24 Sep 2007 16:26:32 +0200 Subject: [PATCH] Bug fixing : 1396 Signed-off-by: Chris Cormack --- circ/circulation.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 8a416893ce..326ea420fb 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -203,21 +203,23 @@ if ($borrowernumber) { Add_Delta_YM( $enrol_year, $enrol_month, $enrol_day, 0 , $borrower->{'enrolmentperiod'}) if ($enrol_year*$enrol_month*$enrol_day>0); # if the expiry date is before today - if ( Date_to_Days( $today_year, $today_month, $today_day ) > - Date_to_Days( $warning_year, $warning_month, $warning_day ) ) + if ( $warning_year*$warning_month*$warning_day==0 + || Date_to_Days( $today_year, $today_month, $today_day ) + > Date_to_Days( $warning_year, $warning_month, $warning_day ) ) { #borrowercard expired or nearly expired, warn the librarian $template->param( flagged => "1", - warndeparture => format_date("$warning_year-$warning_month-$warning_day"), + warndeparture => "1", renewaldate => "$renew_year-$renew_month-$renew_day" ); } # check for NotifyBorrowerDeparture - if (C4::Context->preference('NotifyBorrowerDeparture') && + if ($warning_year*$warning_month*$warning_day==0 + || (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 ) ) + Date_to_Days( $today_year, $today_month, $today_day )) ) { $template->param("warndeparture" => 1); } -- 2.39.5