View | Details | Raw Unified | Return to bug 7802
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-2 / +2 lines)
Lines 2382-2388 sub GetContracts { Link Here
2382
        $query = "SELECT *
2382
        $query = "SELECT *
2383
            FROM aqcontract
2383
            FROM aqcontract
2384
            WHERE booksellerid=?
2384
            WHERE booksellerid=?
2385
                AND contractenddate >= CURDATE( )";
2385
                AND contractenddate >= CAST(now() AS date)";
2386
    }
2386
    }
2387
    my $sth = $dbh->prepare($query);
2387
    my $sth = $dbh->prepare($query);
2388
    $sth->execute( $booksellerid );
2388
    $sth->execute( $booksellerid );
Lines 2439-2445 sub AddClaim { Link Here
2439
    my $query        = "
2439
    my $query        = "
2440
        UPDATE aqorders SET
2440
        UPDATE aqorders SET
2441
            claims_count = claims_count + 1,
2441
            claims_count = claims_count + 1,
2442
            claimed_date = CURDATE()
2442
            claimed_date = CAST(now() AS date)
2443
        WHERE ordernumber = ?
2443
        WHERE ordernumber = ?
2444
        ";
2444
        ";
2445
    my $sth = $dbh->prepare($query);
2445
    my $sth = $dbh->prepare($query);
(-)a/C4/NewsChannels.pm (-2 / +2 lines)
Lines 141-151 sub GetNewsToDisplay { Link Here
141
     SELECT *,timestamp AS newdate
141
     SELECT *,timestamp AS newdate
142
     FROM   opac_news
142
     FROM   opac_news
143
     WHERE   (
143
     WHERE   (
144
        expirationdate >= CURRENT_DATE()
144
        expirationdate >= CAST(now() AS date)
145
        OR    expirationdate IS NULL
145
        OR    expirationdate IS NULL
146
        OR    expirationdate = '00-00-0000'
146
        OR    expirationdate = '00-00-0000'
147
      )
147
      )
148
      AND   `timestamp` <= CURRENT_DATE()
148
      AND   `timestamp` <= CAST(now() AS date)
149
      AND   lang = ?
149
      AND   lang = ?
150
      ORDER BY number
150
      ORDER BY number
151
    ";				# expirationdate field is NOT in ISO format?
151
    ";				# expirationdate field is NOT in ISO format?
(-)a/C4/Reserves.pm (-3 / +3 lines)
Lines 372-378 sub GetReservesFromItemnumber { Link Here
372
    WHERE  itemnumber=?
372
    WHERE  itemnumber=?
373
    ";
373
    ";
374
    unless ( $all_dates ) {
374
    unless ( $all_dates ) {
375
	$query .= " AND reservedate <= CURRENT_DATE()";
375
        $query .= " AND reservedate <= CAST(now() AS date)";
376
    }
376
    }
377
    my $sth_res = $dbh->prepare($query);
377
    my $sth_res = $dbh->prepare($query);
378
    $sth_res->execute($itemnumber);
378
    $sth_res->execute($itemnumber);
Lines 942-948 sub CancelExpiredReserves { Link Here
942
    # Cancel reserves that have passed their expiration date.
942
    # Cancel reserves that have passed their expiration date.
943
    my $dbh = C4::Context->dbh;
943
    my $dbh = C4::Context->dbh;
944
    my $sth = $dbh->prepare( "
944
    my $sth = $dbh->prepare( "
945
        SELECT * FROM reserves WHERE DATE(expirationdate) < DATE( CURDATE() ) 
945
        SELECT * FROM reserves WHERE DATE(expirationdate) < CAST(now() AS date)
946
        AND expirationdate IS NOT NULL
946
        AND expirationdate IS NOT NULL
947
        AND found IS NULL
947
        AND found IS NULL
948
    " );
948
    " );
Lines 1810-1816 sub _Findgroupreserve { Link Here
1810
          AND reserves.reservedate    = reserveconstraints.reservedate )
1810
          AND reserves.reservedate    = reserveconstraints.reservedate )
1811
          OR  reserves.constrainttype='a' )
1811
          OR  reserves.constrainttype='a' )
1812
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1812
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1813
          AND reserves.reservedate <= DATE_ADD(NOW(),INTERVAL ? DAY)
1813
          AND reserves.reservedate <= CAST(now() AS date)
1814
          AND suspend = 0
1814
          AND suspend = 0
1815
    /;
1815
    /;
1816
    $sth = $dbh->prepare($query);
1816
    $sth = $dbh->prepare($query);
(-)a/circ/overdue.pl (-1 / +1 lines)
Lines 297-303 if ($noreport) { Link Here
297
        $strsth .= " AND borrowers.gonenoaddress <> 0";
297
        $strsth .= " AND borrowers.gonenoaddress <> 0";
298
    }
298
    }
299
    elsif ( $borflagsfilter eq 'debarred' ) {
299
    elsif ( $borflagsfilter eq 'debarred' ) {
300
        $strsth .= " AND borrowers.debarred >=  CURDATE()" ;
300
        $strsth .= " AND borrowers.debarred >=  CAST(now() AS date)" ;
301
    }
301
    }
302
    elsif ( $borflagsfilter eq 'lost') {
302
    elsif ( $borflagsfilter eq 'lost') {
303
        $strsth .= " AND borrowers.lost <> 0";
303
        $strsth .= " AND borrowers.lost <> 0";
(-)a/misc/cronjobs/longoverdue.pl (-4 / +3 lines)
Lines 117-123 unless ($confirm) { Link Here
117
}
117
}
118
118
119
# In my opinion, this line is safe SQL to have outside the API. --atz
119
# In my opinion, this line is safe SQL to have outside the API. --atz
120
our $bounds_sth = C4::Context->dbh->prepare("SELECT DATE_SUB(CURDATE(), INTERVAL ? DAY)");
120
our $bounds_sth = C4::Context->dbh->prepare("SELECT DATE_SUB(CAST(now() AS date), INTERVAL ? DAY)");
121
121
122
sub bounds ($) {
122
sub bounds ($) {
123
    $bounds_sth->execute(shift);
123
    $bounds_sth->execute(shift);
Lines 130-137 sub longoverdue_sth { Link Here
130
    SELECT items.itemnumber, borrowernumber, date_due
130
    SELECT items.itemnumber, borrowernumber, date_due
131
      FROM issues, items
131
      FROM issues, items
132
     WHERE items.itemnumber = issues.itemnumber
132
     WHERE items.itemnumber = issues.itemnumber
133
      AND  DATE_SUB(CURDATE(), INTERVAL ? DAY)  > date_due
133
      AND  DATE_SUB(CAST(now() AS date), INTERVAL ? DAY)  > date_due
134
      AND  DATE_SUB(CURDATE(), INTERVAL ? DAY) <= date_due
134
      AND  DATE_SUB(CAST(now() AS date), INTERVAL ? DAY) <= date_due
135
      AND  itemlost <> ?
135
      AND  itemlost <> ?
136
     ORDER BY date_due
136
     ORDER BY date_due
137
    ";
137
    ";
138
- 

Return to bug 7802