[Koha-patches] [PATCH] bug 2502: correctly check patron account expiration

Galen Charlton galen.charlton at liblime.com
Thu Aug 14 18:13:50 CEST 2008


When placing a hold request from the staff interface,
now correctly indicate if the patron account has expired.
Prior to this patch, would warn that the account
had expired even when the expiry date is in the future,
and vice versa.
---
 reserve/request.pl |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/reserve/request.pl b/reserve/request.pl
index f943d3c..8f71bd0 100755
--- a/reserve/request.pl
+++ b/reserve/request.pl
@@ -110,9 +110,10 @@ if ($cardnumber) {
     }
 
     # we check the date expiry of the borrower (only if there is an expiry date, otherwise, set to 1 (warn)
-    my $expiry = $borrowerinfo->{dateexpiry};
-    unless ($expiry and $expiry ne '0000-00-00' and
-            Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry)) {
+    my $expiry_date = $borrowerinfo->{dateexpiry};
+    my $expiry = 0; # flag set if patron account has expired
+    if ($expiry_date and $expiry_date ne '0000-00-00' and
+            Date_to_Days(split /-/,$date) > Date_to_Days(split /-/,$expiry_date)) {
 		$messages = $expiry = 1;
     }
      
-- 
1.5.5.GIT




More information about the Koha-patches mailing list