(bug #2937) use check_date in C4::Serials::hassubscriptionexpired
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Fri, 30 Jan 2009 15:48:02 +0000 (16:48 +0100)
committerJohn Soros <john.soros@biblibre.com>
Tue, 28 Apr 2009 11:15:12 +0000 (13:15 +0200)
This patch change the date check in hassubscriptionexpired to use Date_Calc::check_date

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Serials.pm

index e087012..2cea727 100644 (file)
@@ -1806,9 +1806,7 @@ sub HasSubscriptionExpired {
          return 0 unless $res;
       my @res=split (/-/,$res);
       my @endofsubscriptiondate=split(/-/,$expirationdate);
-      foreach (@res,@endofsubscriptiondate){
-        return 2 unless $_ ;
-      } 
+      return 2 if (not check_date(@res) || not check_date(@endofsubscriptiondate));
       return 1 if ( (@endofsubscriptiondate && Delta_Days($res[0],$res[1],$res[2],
                   $endofsubscriptiondate[0],$endofsubscriptiondate[1],$endofsubscriptiondate[2]) <= 0)
                   || (!$res));