[Koha-patches] [PATCH] (bug #2937) use check_date in C4::Serials::hassubscriptionexpired
Nahuel ANGELINETTI
nahuel.angelinetti at biblibre.com
Fri Jan 30 16:48:02 CET 2009
This patch change the date check in hassubscriptionexpired to use Date_Calc::check_date
---
C4/Serials.pm | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/C4/Serials.pm b/C4/Serials.pm
index 7b868f8..4d10615 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -1798,9 +1798,7 @@ sub HasSubscriptionExpired {
my ($res) = $sth->fetchrow ;
my @res=split (/-/,$res);
my @endofsubscriptiondate=split(/-/,$expirationdate);
- foreach (@res, at 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));
--
1.5.6.3
More information about the Koha-patches
mailing list