From 19b46abad1cbcbd435858edee22b5fe2329b0c77 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Mon, 14 Jul 2008 12:15:13 -0500 Subject: [PATCH] fix number two for 2181: Late Items in Red This new patch uses faster Perl string comparison when comparing dates for overdue checking. Signed-off-by: Joshua Ferraro --- circ/circulation.pl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 61babaad47..8c53bdc762 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -434,9 +434,6 @@ if ($borrower) { # set itemtype per item-level_itype syspref - FIXME this is an ugly hack $it->{'itemtype'} = (C4::Context->preference('item-level_itypes')) ? $it->{'itype'} : $it->{'itemtype'}; - my $issuedate = $it->{'issuedate'}; - $issuedate =~ s/-//g; - $issuedate = substr( $issuedate, 0, 8 ); ($it->{'charge'}, $it->{'itemtype_charge'}) = GetIssuingCharges( $it->{'itemnumber'}, $borrower->{'borrowernumber'} ); @@ -450,15 +447,13 @@ 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'} = ($it->{'date_due'} lt $todaysdate) ? 1 : 0 ; ($it->{'author'} eq '') and $it->{'author'} = ' '; $it->{'renew_failed'} = $renew_failed[$it->{'itemnumber'}]; # ADDED BY JF: NEW ITEMTYPE COUNT DISPLAY $issued_itemtypes_count->{ $it->{'itemtype'} }++; - if ( $todaysdate == $issuedate ) { + if ( $todaysdate == $it->{'issuedate'} ) { push @todaysissues, $it; } else { push @previousissues, $it; -- 2.39.5