bugfix invalid comparison to ceilingDueDate in CalcDateDue()

The comparison to check the ceilingDueDate is done in the syspref format,
which isn't a good comparison.  This changes to code so the comparison is done
using iso format.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Michael Hafen 2009-08-13 16:12:33 -06:00 committed by Galen Charlton
parent e60b571d6d
commit 2ace8cb33d

View file

@ -2499,9 +2499,11 @@ sub CalcDateDue {
# if ceilingDueDate ON the datedue can't be after the ceiling date
if ( C4::Context->preference('ceilingDueDate')
&& ( C4::Context->preference('ceilingDueDate') =~ C4::Dates->regexp('syspref') )
&& $datedue->output gt C4::Context->preference('ceilingDueDate') ) {
$datedue = C4::Dates->new( C4::Context->preference('ceilingDueDate') );
&& ( C4::Context->preference('ceilingDueDate') =~ C4::Dates->regexp('syspref') ) ) {
my $ceilingDate = C4::Dates->new( C4::Context->preference('ceilingDueDate') );
if ( $datedue->output( 'iso' ) gt $ceilingDate->output( 'iso' ) ) {
$datedue = $ceilingDate;
}
}
return $datedue;