From 2ace8cb33d65c32da2fe90d9748fff90ffa3c3b4 Mon Sep 17 00:00:00 2001 From: Michael Hafen Date: Thu, 13 Aug 2009 16:12:33 -0600 Subject: [PATCH] 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 --- C4/Circulation.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 78215ffa35..adc7f8fe08 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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; -- 2.39.2