#1459 yadc : Yet Another Date::Calc problem...
authorPaul POULAIN <paul@koha-fr.org>
Fri, 5 Oct 2007 09:39:38 +0000 (04:39 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Sat, 6 Oct 2007 00:46:46 +0000 (19:46 -0500)
if dateexpiry is empty, set issuingimpossible without any calculation

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Circulation.pm

index 71a9dc1..6917110 100644 (file)
@@ -681,15 +681,15 @@ sub CanBookBeIssued {
     if ( $borrower->{flags}->{'DBARRED'} ) {
         $issuingimpossible{DEBARRED} = 1;
     }
-    if ( Date_to_Days(Today) > 
-        Date_to_Days( split "-", $borrower->{'dateexpiry'} ) )
-    {
-
-        #
-        #if (&Date_Cmp(&ParseDate($borrower->{expiry}),&ParseDate("today"))<0) {
+    if ( $borrower->{'dateexpiry'} eq '0000-00-00') {
         $issuingimpossible{EXPIRED} = 1;
+    } else {
+        if ( Date_to_Days(Today) > 
+            Date_to_Days( split "-", $borrower->{'dateexpiry'} ) )
+        {
+            $issuingimpossible{EXPIRED} = 1;
+        }
     }
-
     #
     # BORROWER STATUS
     #