Bug 5549 : replace curdate with now in a couple of sql lines
authorColin Campbell <colin.campbell@ptfs-europe.com>
Mon, 20 Jun 2011 14:48:57 +0000 (15:48 +0100)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 20 Mar 2012 00:20:42 +0000 (13:20 +1300)
duedate is now datetime and comparing with curdate
causes a system error

C4/Members.pm

index 434a018..1f0ac3f 100644 (file)
@@ -642,7 +642,7 @@ sub IsMemberBlocked {
         "SELECT COUNT(*) as latedocs
          FROM issues
          WHERE borrowernumber = ?
-         AND date_due < curdate()"
+         AND date_due < now()"
     );
     $sth->execute($borrowernumber);
     my $latedocs = $sth->fetchrow_hashref->{'latedocs'};
@@ -680,7 +680,7 @@ sub GetMemberIssuesAndFines {
     $sth = $dbh->prepare(
         "SELECT COUNT(*) FROM issues 
          WHERE borrowernumber = ? 
-         AND date_due < curdate()"
+         AND date_due < now()"
     );
     $sth->execute($borrowernumber);
     my $overdue_count = $sth->fetchrow_arrayref->[0];