fix for 2181: Late Items in Red
authorJesse Weaver <jesse.weaver@liblime.com>
Thu, 10 Jul 2008 18:21:28 +0000 (13:21 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 10 Jul 2008 20:03:37 +0000 (15:03 -0500)
Modified overdue check in circ/circulation.pl to use Date::Manip's Date_Cmp. This would likely be useful other places in the file.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
circ/circulation.pl

index 61babaa..b165d68 100755 (executable)
@@ -44,6 +44,10 @@ use Date::Calc qw(
   Date_to_Days
 );
 
+use Date::Manip qw(
+  Date_Cmp
+);
+
 
 #
 # PARAMETERS READING
@@ -450,9 +454,7 @@ if ($borrower) {
     ($restype) and $it->{'can_renew'} = 0;
 
     $it->{'dd'} = format_date($it->{'date_due'});
-        my $datedue = $it->{'date_due'};
-        $datedue =~ s/-//g;
-    $it->{'od'} = ($datedue < $todaysdate) ? 1 : 0 ;
+    $it->{'od'} = Date_Cmp($todaysdate, $it->{'date_due'}) == 1 ? 1 : 0 ;
         ($it->{'author'} eq '') and $it->{'author'} = ' ';
         $it->{'renew_failed'} = $renew_failed[$it->{'itemnumber'}];
         # ADDED BY JF: NEW ITEMTYPE COUNT DISPLAY