]> git.koha-community.org Git - koha.git/commit
Bug 24002: Incorrect DATE value: '' in C4/Acquisition.pm
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 8 Nov 2019 13:49:48 +0000 (14:49 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 12 Nov 2019 13:50:23 +0000 (13:50 +0000)
commita70320077c7bb9878762e42d39211ab4de8e19dd
treef5895026ac6181f075936b192614e1634826f712
parentb16c7c0615f41dde587370ba32ca5711ae8127dd
Bug 24002: Incorrect DATE value: '' in C4/Acquisition.pm

DBD::mysql::st execute failed: Incorrect DATE value: '' [for Statement "
    SELECT aqbasket.basketno,
        aqorders.ordernumber,
        DATE(aqbasket.closedate)  AS orderdate,
        aqbasket.basketname       AS basketname,
        aqbasket.basketgroupid    AS basketgroupid,
        aqbasketgroups.name       AS basketgroupname,
        aqorders.rrp              AS unitpricesupplier,
        aqorders.ecost            AS unitpricelib,
        aqorders.claims_count     AS claims_count,
        aqorders.claimed_date     AS claimed_date,
        aqbudgets.budget_name     AS budget,
        borrowers.branchcode      AS branch,
        aqbooksellers.name        AS supplier,
        aqbooksellers.id          AS supplierid,
        biblio.author, biblio.title,
        biblioitems.publishercode AS publisher,
        biblioitems.publicationyear,
        ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate,

        aqorders.quantity - COALESCE(aqorders.quantityreceived,0)                 AS quantity,
        (aqorders.quantity - COALESCE(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
        DATEDIFF(CAST(now() AS date),closedate) AS latesince

    FROM
        aqorders LEFT JOIN biblio     ON biblio.biblionumber         = aqorders.biblionumber
        LEFT JOIN biblioitems         ON biblioitems.biblionumber    = biblio.biblionumber
        LEFT JOIN aqbudgets           ON aqorders.budget_id          = aqbudgets.budget_id,
        aqbasket LEFT JOIN borrowers  ON aqbasket.authorisedby       = borrowers.borrowernumber
        LEFT JOIN aqbooksellers       ON aqbasket.booksellerid       = aqbooksellers.id
        LEFT JOIN aqbasketgroups      ON aqbasket.basketgroupid      = aqbasketgroups.id
        WHERE aqorders.basketno = aqbasket.basketno
        AND ( datereceived = ''
            OR datereceived IS NULL
            OR aqorders.quantityreceived < aqorders.quantity
        )
        AND aqbasket.closedate IS NOT NULL
        AND aqorders.datecancellationprinted IS NULL
     AND (closedate <= DATE_SUB(CAST(now() AS date),INTERVAL ? DAY))  AND aqorders.quantity - COALESCE(aqorders.quantityreceived,0) <> 0 AND orderstatus <> 'cancelled'
ORDER BY latesince, basketno, borrowers.branchcode, supplier" with ParamValues: 0=0] at /kohadevbox/koha/C4/Acquisition.pm line 2248.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Acquisition.pm